From 7402ff0b8c5e6bfd06ce2b8d5da26c55530d07fc Mon Sep 17 00:00:00 2001 From: frank Date: Wed, 23 Nov 2011 17:32:45 -0800 Subject: [PATCH] Bug 11990 - Add encryption properties to db.properties during install better help message --- setup/bindir/cloud-setup-databases.in | 28 +++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/setup/bindir/cloud-setup-databases.in b/setup/bindir/cloud-setup-databases.in index cbe5a2b1023..28d4742f373 100755 --- a/setup/bindir/cloud-setup-databases.in +++ b/setup/bindir/cloud-setup-databases.in @@ -69,9 +69,10 @@ class DBDeployer(object): def cleanOrRecoverDbDotProperties(): dbpPath = os.path.join(self.dbConfPath, 'db.properties') copyPath = os.path.join(self.dbConfPath, 'db.properties.origin') - if not self.success: - shutil.copy2(copyPath, dbpPath) - os.remove(copyPath) + if os.path.isfile(copyPath): + if not self.success: + shutil.copy2(copyPath, dbpPath) + os.remove(copyPath) cleanOrRecoverDbDotProperties() @@ -179,13 +180,20 @@ Sql parameters: def errorAndExit(self, msg): self.postRun() - if self.parser != None: - self.parser.error(msg) - else: - sys.stderr.write(msg) - sys.stderr.flush() - sys.exit(1) - + err = '''\n\nWe apologize for below error: +*************************************************************** +%s +*************************************************************** +Please run: + + cloud-setup-database -h + +for full help +''' % msg + sys.stderr.write(err) + sys.stderr.flush() + sys.exit(1) + def setupDBSchema(self): if not self.rootuser: self.info("No mysql root user specified, will not create Cloud DB schema\n", None)