Skip to content

Commit 23280a4

Browse files
Damodar ReddyAbhinandan Prateek
authored andcommitted
CLOUDSTACK-6702 : [Windows]Due to Progress bar changes mysql path was not getting read. Fixing the same.
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
1 parent e61dda7 commit 23280a4

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

scripts/installer/windows/acs.wxs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,10 @@
258258
ExeCommand='[PYTHON_HOME]\python "[CSMANAGEMENT]\webapps\client\WEB-INF\classes\scripts\common\keys\ssl-keys.py" "[CSMANAGEMENT]\lib"'
259259
Execute="deferred" Return="check" />
260260
<CustomAction Id="DeployDB" Directory='CSMANAGEMENT'
261-
ExeCommand='[PYTHON_HOME]\python "[INSTALLDIR]\scripts\cloud-setup-databases" [DB_USERNAME]:[DB_PASSWORD]@[DB_HOSTNAME] --deploy-as=root:[DB_ROOT_PASSWORD] -c "[CSMANAGEMENT]\lib" -f "[CSMANAGEMENT]\setup" -j "[CSMANAGEMENT]\webapps\client\WEB-INF\lib\jasypt-1.9.0.jar" -n "[CSMANAGEMENT]\lib\key"'
261+
ExeCommand='[PYTHON_HOME]\python "[INSTALLDIR]\scripts\cloud-setup-databases" [DB_USERNAME]:[DB_PASSWORD]@[DB_HOSTNAME] --deploy-as=root:[DB_ROOT_PASSWORD] -c "[CSMANAGEMENT]\lib" -f "[CSMANAGEMENT]\setup" -j "[CSMANAGEMENT]\webapps\client\WEB-INF\lib\jasypt-1.9.0.jar" -n "[CSMANAGEMENT]\lib\key" -b "[MYSQL]\bin"'
262262
Execute="deferred" Return="check" Impersonate="no"/>
263263
<CustomAction Id="SetupDatabases" Directory='CSMANAGEMENT'
264-
ExeCommand='[PYTHON_HOME]\python "[INSTALLDIR]\scripts\cloud-setup-databases" [DB_USERNAME]:[DB_PASSWORD]@[DB_HOSTNAME] -c "[CSMANAGEMENT]\lib" -f "[CSMANAGEMENT]\setup" -j "[CSMANAGEMENT]\webapps\client\WEB-INF\lib\jasypt-1.9.0.jar" -n "[CSMANAGEMENT]\lib\key"'
264+
ExeCommand='[PYTHON_HOME]\python "[INSTALLDIR]\scripts\cloud-setup-databases" [DB_USERNAME]:[DB_PASSWORD]@[DB_HOSTNAME] -c "[CSMANAGEMENT]\lib" -f "[CSMANAGEMENT]\setup" -j "[CSMANAGEMENT]\webapps\client\WEB-INF\lib\jasypt-1.9.0.jar" -n "[CSMANAGEMENT]\lib\key" -b "[MYSQL]\bin"'
265265
Execute="deferred" Return="check" Impersonate="no"/>
266266

267267
<InstallExecuteSequence>

setup/bindir/cloud-setup-databases.in

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ class DBDeployer(object):
7171
success = False
7272
magicString = 'This_is_a_magic_string_i_think_no_one_will_duplicate'
7373
tmpMysqlFile = os.path.join(os.path.expanduser('~/'), 'cloudstackmysql.tmp.sql')
74+
mysqlBinPath = None
7475

7576
def preRun(self):
7677
def backUpDbDotProperties():
@@ -138,9 +139,12 @@ class DBDeployer(object):
138139

139140
kwargs['port'] = self.port
140141
kwargs['host'] = self.host
141-
142+
if self.mysqlBinPath is not None:
143+
mysqlPath = '"' + self.mysqlBinPath + os.sep + "mysql" + '"'
144+
else:
145+
mysqlPath = "mysql"
142146
try:
143-
mysqlCmds = ['mysql', '--user=%s'%kwargs['user'], '--host=%s'%kwargs['host'], '--port=%s'%kwargs['port']]
147+
mysqlCmds = [mysqlPath, '--user=%s'%kwargs['user'], '--host=%s'%kwargs['host'], '--port=%s'%kwargs['port']]
144148
if kwargs.has_key('passwd'):
145149
mysqlCmds.append('--password=%s'%kwargs['passwd'])
146150
file(self.tmpMysqlFile, 'w').write(text)
@@ -462,6 +466,8 @@ for example:
462466
self.encryptionKeyFile = self.options.encryptionKeyFile
463467
if self.options.encryptionJarPath:
464468
self.encryptionJarPath = self.options.encryptionJarPath
469+
if self.options.mysqlbinpath:
470+
self.mysqlBinPath = self.options.mysqlbinpath
465471

466472
def parseUserAndPassword(cred):
467473
stuff = cred.split(':')
@@ -582,6 +588,7 @@ for example:
582588
self.parser.add_option("-f", "--db-files-path", action="store", dest="dbFilesPath", help="The path to find sql files to create initial database(s)")
583589
self.parser.add_option("-j", "--encryption-jar-path", action="store", dest="encryptionJarPath", help="The path to the jasypt library to be used to encrypt the values in db.properties")
584590
self.parser.add_option("-n", "--encryption-key-file", action="store", dest="encryptionKeyFile", help="The name of the file in which encryption key to be generated")
591+
self.parser.add_option("-b", "--mysql-bin-path", action="store", dest="mysqlbinpath", help="The mysql installed bin path")
585592

586593
(self.options, self.args) = self.parser.parse_args()
587594
parseCasualCredit()

0 commit comments

Comments
 (0)