Skip to content

Commit 375ec2c

Browse files
committed
bug fix: host selection in remote host;
1 parent 888aec2 commit 375ec2c

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎plogical/mysqlUtilities.py‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ def setupConnection():
8282

8383
mysqlUtilities.LOCALHOST = ipAddressLocal
8484

85+
if os.path.exists(ProcessUtilities.debugPath):
86+
logging.CyberCPLogFileWriter.writeToFile('Local IP for MySQL: %s' % (mysqlUtilities.LOCALHOST))
87+
8588
conn = mysql.connect(host=mysqlhost ,user=mysqluser, passwd=mysqlpassword, port=int(mysqlport), cursorclass=cursors.SSCursor)
8689
cursor = conn.cursor()
8790

@@ -109,18 +112,15 @@ def setupConnection():
109112
@staticmethod
110113
def createDatabase(dbname,dbuser,dbpassword, dbcreate = 1, host = None):
111114
try:
112-
113-
if dbcreate:
114-
HostToUse = mysqlUtilities.LOCALHOST
115-
else:
116-
HostToUse = host
117-
118115
connection, cursor = mysqlUtilities.setupConnection()
119116

120117
if connection == 0:
121118
return 0
122119

123-
120+
if dbcreate == 1:
121+
HostToUse = mysqlUtilities.LOCALHOST
122+
else:
123+
HostToUse = host
124124
## Create db
125125

126126
if dbcreate:

0 commit comments

Comments
 (0)