mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
migrate-dynamicroles: use mysql.connector due to #1054
Due to PR #1054 this patch fixes the dynamic-roles migration script to use the mysql-connector-python dependency. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
20638caaa4
commit
05e1db7373
@ -25,9 +25,9 @@ from contextlib import closing
|
||||
from optparse import OptionParser
|
||||
|
||||
try:
|
||||
import MySQLdb
|
||||
import mysql.connector
|
||||
except ImportError:
|
||||
print("MySQLdb cannot be imported, please install python-mysqldb(apt) or mysql-python(yum)")
|
||||
print("mysql.connector cannot be imported, please install mysql-connector-python")
|
||||
sys.exit(1)
|
||||
|
||||
dryrun = False
|
||||
@ -82,7 +82,7 @@ def main():
|
||||
if options.dryrun:
|
||||
dryrun = True
|
||||
|
||||
conn = MySQLdb.connect(
|
||||
conn = mysql.connector.connect(
|
||||
host=options.host,
|
||||
user=options.user,
|
||||
passwd=options.password,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user