mirror of https://github.com/apache/cloudstack.git
merge cloud-setup-bridge-db to cloud-setup-databases
This commit is contained in:
parent
2a64b1fff8
commit
2f87c2212f
|
|
@ -1,15 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# Cloud.com Bridge DB setup script.
|
||||
#
|
||||
|
||||
from getpass import getpass
|
||||
from subprocess import call
|
||||
|
||||
setup_db_dir = '/usr/share/cloud/setup/bridge/db'
|
||||
setup_db_script = 'deploy-db-bridge.sh'
|
||||
|
||||
print 'Welcome to CloudBridge Database setup.'
|
||||
passwd = getpass('Please enter the MySQL password for root@localhost: ')
|
||||
|
||||
call(['/bin/bash', setup_db_script, 'cloud', 'root', passwd], cwd=setup_db_dir)
|
||||
|
|
@ -127,10 +127,17 @@ class DBDeployer(object):
|
|||
mysqlCmds = ['mysql', '--user=%s'%kwargs['user'], '--host=%s'%kwargs['host'], '--port=%s'%kwargs['port']]
|
||||
if kwargs.has_key('passwd'):
|
||||
mysqlCmds.append('--password=%s'%kwargs['passwd'])
|
||||
passwd = kwargs['passwd']
|
||||
else:
|
||||
passwd = ''
|
||||
file(self.tmpMysqlFile, 'w').write(text)
|
||||
mysqlCmds.append('<')
|
||||
mysqlCmds.append(self.tmpMysqlFile)
|
||||
runCmd(mysqlCmds)
|
||||
|
||||
awsApiDbDir = '/usr/share/cloud/setup/bridge/db'
|
||||
awsApiCmds = ['cd %s'%awsApiDbDir, 'sh deploy-db-bridge.sh %s'%passwd, 'cd -']
|
||||
runCmd(awsApiCmds)
|
||||
except Exception, e:
|
||||
err = '''Encountering an error when executing mysql script
|
||||
----------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in New Issue