fix chars

This commit is contained in:
VirtuBox
2019-04-03 07:22:59 +02:00
parent 2c8b03ac5c
commit 5e27ada4ab

View File

@@ -1146,29 +1146,29 @@ class WOStackController(CementBaseController):
shutil.move('/tmp/Anemometer-master',
'{0}22222/htdocs/db/anemometer'
.format(WOVariables.wo_webroot))
chars = ''.join(random.sample(string.ascii_letters, 8))
try:
WOShellExec.cmd_exec(self, 'mysql < {0}22222/htdocs/db'
'/anemometer/install.sql'
.format(WOVariables.wo_webroot))
except CommandExecutionError as e:
raise SiteError("Unable to import Anemometer database")
chars = ''.join(random.sample(string.ascii_letters, 8))
try:
WOShellExec.cmd_exec(self, 'mysql < {0}22222/htdocs/db'
'/anemometer/install.sql'
.format(WOVariables.wo_webroot))
except CommandExecutionError as e:
raise SiteError("Unable to import Anemometer database")
WOMysql.execute(self, 'grant select on'
' *.* to \'anemometer\''
'@\'{0}\' IDENTIFIED'
' BY \'{1}\''.format(self.app.config.get
('mysql', 'grant-host'),
chars))
Log.debug(self, "grant all on slow-query-log.*"
" to anemometer@root_user"
" IDENTIFIED BY password ")
WOMysql.execute(self, 'grant all on slow_query_log.* to'
'\'anemometer\'@\'{0}\' IDENTIFIED'
' BY \'{1}\''.format(self.app.config.get(
'mysql', 'grant-host'),
chars),
errormsg="cannot grant priviledges", log=False)
WOMysql.execute(self, 'grant select on'
' *.* to \'anemometer\''
'@\'{0}\' IDENTIFIED'
' BY \'{1}\''.format(self.app.config.get
('mysql', 'grant-host'),
chars))
Log.debug(self, "grant all on slow-query-log.*"
" to anemometer@root_user"
" IDENTIFIED BY password ")
WOMysql.execute(self, 'grant all on slow_query_log.* to'
'\'anemometer\'@\'{0}\' IDENTIFIED'
' BY \'{1}\''.format(self.app.config.get(
'mysql', 'grant-host'),
chars),
errormsg="cannot grant priviledges", log=False)
# Custom Anemometer configuration
Log.debug(self, "configration Anemometer")