CLOUDSTACK-6271: The cloud-setup-databases was failing when your jasypt jar path has spaces in it's path

This commit is contained in:
Damodar Reddy 2014-04-28 14:16:06 +05:30 committed by Murali Reddy
parent 8d92d00c87
commit 29b4fe6d9f
3 changed files with 39 additions and 8 deletions

View File

@ -705,6 +705,11 @@
<include name="**/*" /> <include name="**/*" />
</fileset> </fileset>
</copy> </copy>
<copy todir="./target/python-site-packages">
<fileset dir="../python/lib">
<include name="**/*" />
</fileset>
</copy>
</target> </target>
</configuration> </configuration>
</execution> </execution>
@ -779,6 +784,21 @@
<goal>heat</goal> <goal>heat</goal>
</goals> </goals>
</execution> </execution>
<execution>
<id>python-site-packages</id>
<configuration>
<vars>-var wix.PythonSitePackagesDir</vars>
<workingDirectory>${basedir}/target</workingDirectory>
<dir>python-site-packages</dir>
<template>fragment</template>
<directoryName>INSTALLDIR</directoryName>
<outputFile>target/python-site-packages.wxs</outputFile>
<componentGroup>PythonSitePackagesPath</componentGroup>
</configuration>
<goals>
<goal>heat</goal>
</goals>
</execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
@ -791,7 +811,7 @@
<extension>WixFirewallExtension</extension> <extension>WixFirewallExtension</extension>
<extension>WixUIExtension</extension> <extension>WixUIExtension</extension>
</extensions> </extensions>
<arguments>-dSourceClient=SourceDir\client -dSetupPathDir=SourceDir\setup -dUtilitiesPathDir=SourceDir\scripts</arguments> <arguments>-dSourceClient=SourceDir\client -dSetupPathDir=SourceDir\setup -dUtilitiesPathDir=SourceDir\scripts -dPythonSitePackagesDir=SourceDir\python-site-packages</arguments>
<sourceFiles> <sourceFiles>
<sourceFile>../scripts/installer/windows/acs.wxs</sourceFile> <sourceFile>../scripts/installer/windows/acs.wxs</sourceFile>
<sourceFile>../scripts/installer/windows/WixInstallerDialog.wxs</sourceFile> <sourceFile>../scripts/installer/windows/WixInstallerDialog.wxs</sourceFile>
@ -799,6 +819,7 @@
<sourceFile>target/client.wxs</sourceFile> <sourceFile>target/client.wxs</sourceFile>
<sourceFile>target/setupdb.wxs</sourceFile> <sourceFile>target/setupdb.wxs</sourceFile>
<sourceFile>target/utilities.wxs</sourceFile> <sourceFile>target/utilities.wxs</sourceFile>
<sourceFile>target/python-site-packages.wxs</sourceFile>
</sourceFiles> </sourceFiles>
<outputDirectory>target</outputDirectory> <outputDirectory>target</outputDirectory>
<objectFiles> <objectFiles>
@ -808,6 +829,7 @@
<objectFile>target/utilities.wixobj</objectFile> <objectFile>target/utilities.wixobj</objectFile>
<objectFile>target/WixInstallerDialog.wixobj</objectFile> <objectFile>target/WixInstallerDialog.wixobj</objectFile>
<objectFile>target/Setup_Databases.wixobj</objectFile> <objectFile>target/Setup_Databases.wixobj</objectFile>
<objectFile>target/python-site-packages.wixobj</objectFile>
</objectFiles> </objectFiles>
<outputFile>target/acs.msi</outputFile> <outputFile>target/acs.msi</outputFile>
</configuration> </configuration>

View File

@ -226,17 +226,23 @@
<CustomAction Id="UpdateTomcatClassPath" <CustomAction Id="UpdateTomcatClassPath"
ExeCommand='//US//Tomcat6 --Classpath="[TOMCATDIRECTORY]\bin\bootstrap.jar";"[TOMCATDIRECTORY]\bin\tomcat-juli.jar";[CSMANAGEMENT]\conf;[CSMANAGEMENT]\lib;[CSMANAGEMENT]\setup' ExeCommand='//US//Tomcat6 --Classpath="[TOMCATDIRECTORY]\bin\bootstrap.jar";"[TOMCATDIRECTORY]\bin\tomcat-juli.jar";[CSMANAGEMENT]\conf;[CSMANAGEMENT]\lib;[CSMANAGEMENT]\setup'
Property="TOMCATDIRECTORY1" Execute="commit" Return="check" /> Property="TOMCATDIRECTORY1" Execute="commit" Return="check" />
<CustomAction Id="CopySitePackages" Directory='INSTALLDIR'
ExeCommand='[SystemFolder]cmd.exe /c xcopy /S "[INSTALLDIR]\python-site-packages" [PYTHON_HOME]\Lib\site-packages'
Execute="commit" Return="check" />
<CustomAction Id="DeleteDirectory" Directory='INSTALLDIR'
ExeCommand='[SystemFolder]cmd.exe /c RD /S /Q "[INSTALLDIR]\python-site-packages"'
Execute="commit" Return="check" />
<CustomAction Id="DeleteFiles" Directory='CSMANAGEMENT' <CustomAction Id="DeleteFiles" Directory='CSMANAGEMENT'
ExeCommand="[SystemFolder]cmd.exe /c del [CSMANAGEMENT]\webapps\client\WEB-INF\classes\db.properties [CSMANAGEMENT]\webapps\client\WEB-INF\classes\log4j*.xml" ExeCommand='[SystemFolder]cmd.exe /c del "[CSMANAGEMENT]\webapps\client\WEB-INF\classes\db.properties" "[CSMANAGEMENT]\webapps\client\WEB-INF\classes\log4j*.xml"'
Execute="commit" Return="check" /> Execute="commit" Return="check" />
<CustomAction Id="GenerateSSLKey" Directory='CSMANAGEMENT' <CustomAction Id="GenerateSSLKey" Directory='CSMANAGEMENT'
ExeCommand="[PYTHON_HOME]\python [CSMANAGEMENT]\webapps\client\WEB-INF\classes\scripts\common\keys\ssl-keys.py [CSMANAGEMENT]\lib" ExeCommand='[PYTHON_HOME]\python "[CSMANAGEMENT]\webapps\client\WEB-INF\classes\scripts\common\keys\ssl-keys.py" "[CSMANAGEMENT]\lib"'
Execute="commit" Return="check" /> Execute="commit" Return="check" />
<CustomAction Id="DeployDB" Directory='CSMANAGEMENT' <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"'
Execute="commit" Return="check" /> Execute="commit" Return="check" />
<CustomAction Id="SetupDatabases" Directory='CSMANAGEMENT' <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"'
Execute="commit" Return="check" /> Execute="commit" Return="check" />
<InstallExecuteSequence> <InstallExecuteSequence>
@ -244,9 +250,11 @@
<Custom Action="TomcatPath" Before="UpdateTomcatClassPath">NOT Installed</Custom> <Custom Action="TomcatPath" Before="UpdateTomcatClassPath">NOT Installed</Custom>
<Custom Action="UpdateTomcatClassPath" Before="UpdateTomcatCatalinaBase">NOT Installed <Custom Action="UpdateTomcatClassPath" Before="UpdateTomcatCatalinaBase">NOT Installed
</Custom> </Custom>
<Custom Action="UpdateTomcatCatalinaBase" Before="DeleteFiles">NOT <Custom Action="UpdateTomcatCatalinaBase" Before="CopySitePackages">NOT
Installed</Custom> Installed</Custom>
<Custom Action="DeleteFiles" Before="GenerateSSLKey">NOT Installed</Custom> <Custom Action="CopySitePackages" Before="DeleteFiles">NOT Installed</Custom>
<Custom Action="DeleteFiles" Before="DeleteDirectory">NOT Installed</Custom>
<Custom Action="DeleteDirectory" Before="GenerateSSLKey">NOT Installed</Custom>
<Custom Action="GenerateSSLKey" Before="InstallFinalize">NOT Installed <Custom Action="GenerateSSLKey" Before="InstallFinalize">NOT Installed
</Custom> </Custom>
<Custom Action="DeployDB" Before="InstallFinalize">(NOT Installed) AND (CREATE_DATABASE = "1") <Custom Action="DeployDB" Before="InstallFinalize">(NOT Installed) AND (CREATE_DATABASE = "1")
@ -262,6 +270,7 @@
<ComponentGroupRef Id='ClientPath' /> <ComponentGroupRef Id='ClientPath' />
<ComponentGroupRef Id='SetupPath' /> <ComponentGroupRef Id='SetupPath' />
<ComponentGroupRef Id='UtilitiesPath' /> <ComponentGroupRef Id='UtilitiesPath' />
<ComponentGroupRef Id='PythonSitePackagesPath' />
<ComponentRef Id='ProgramMenuDir' /> <ComponentRef Id='ProgramMenuDir' />
<ComponentRef Id='confFolder' /> <ComponentRef Id='confFolder' />
<ComponentRef Id='libFolder' /> <ComponentRef Id='libFolder' />

View File

@ -397,7 +397,7 @@ for example:
def processEncryptionStuff(self): def processEncryptionStuff(self):
def encrypt(input): def encrypt(input):
cmd = ['java','-classpath',self.encryptionJarPath,'org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI', 'encrypt.sh', 'input=%s'%input, 'password=%s'%self.mgmtsecretkey,'verbose=false'] cmd = ['java','-classpath','"' + self.encryptionJarPath + '"','org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI', 'encrypt.sh', 'input=%s'%input, 'password=%s'%self.mgmtsecretkey,'verbose=false']
return runCmd(cmd).strip('\r\n') return runCmd(cmd).strip('\r\n')
def saveMgmtServerSecretKey(): def saveMgmtServerSecretKey():