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>
This commit is contained in:
Damodar Reddy 2014-06-05 15:45:53 +05:30 committed by Abhinandan Prateek
parent e61dda7d82
commit 23280a47b8
2 changed files with 11 additions and 4 deletions

View File

@ -258,10 +258,10 @@
ExeCommand='[PYTHON_HOME]\python "[CSMANAGEMENT]\webapps\client\WEB-INF\classes\scripts\common\keys\ssl-keys.py" "[CSMANAGEMENT]\lib"'
Execute="deferred" Return="check" />
<CustomAction Id="DeployDB" Directory='CSMANAGEMENT'
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"'
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"'
Execute="deferred" Return="check" Impersonate="no"/>
<CustomAction Id="SetupDatabases" Directory='CSMANAGEMENT'
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"'
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"'
Execute="deferred" Return="check" Impersonate="no"/>
<InstallExecuteSequence>

View File

@ -71,6 +71,7 @@ class DBDeployer(object):
success = False
magicString = 'This_is_a_magic_string_i_think_no_one_will_duplicate'
tmpMysqlFile = os.path.join(os.path.expanduser('~/'), 'cloudstackmysql.tmp.sql')
mysqlBinPath = None
def preRun(self):
def backUpDbDotProperties():
@ -138,9 +139,12 @@ class DBDeployer(object):
kwargs['port'] = self.port
kwargs['host'] = self.host
if self.mysqlBinPath is not None:
mysqlPath = '"' + self.mysqlBinPath + os.sep + "mysql" + '"'
else:
mysqlPath = "mysql"
try:
mysqlCmds = ['mysql', '--user=%s'%kwargs['user'], '--host=%s'%kwargs['host'], '--port=%s'%kwargs['port']]
mysqlCmds = [mysqlPath, '--user=%s'%kwargs['user'], '--host=%s'%kwargs['host'], '--port=%s'%kwargs['port']]
if kwargs.has_key('passwd'):
mysqlCmds.append('--password=%s'%kwargs['passwd'])
file(self.tmpMysqlFile, 'w').write(text)
@ -462,6 +466,8 @@ for example:
self.encryptionKeyFile = self.options.encryptionKeyFile
if self.options.encryptionJarPath:
self.encryptionJarPath = self.options.encryptionJarPath
if self.options.mysqlbinpath:
self.mysqlBinPath = self.options.mysqlbinpath
def parseUserAndPassword(cred):
stuff = cred.split(':')
@ -582,6 +588,7 @@ for example:
self.parser.add_option("-f", "--db-files-path", action="store", dest="dbFilesPath", help="The path to find sql files to create initial database(s)")
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")
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")
self.parser.add_option("-b", "--mysql-bin-path", action="store", dest="mysqlbinpath", help="The mysql installed bin path")
(self.options, self.args) = self.parser.parse_args()
parseCasualCredit()