another fix for anemometer
This commit is contained in:
@@ -1146,41 +1146,41 @@ class WOStackController(CementBaseController):
|
|||||||
shutil.move('/tmp/Anemometer-master',
|
shutil.move('/tmp/Anemometer-master',
|
||||||
'{0}22222/htdocs/db/anemometer'
|
'{0}22222/htdocs/db/anemometer'
|
||||||
.format(WOVariables.wo_webroot))
|
.format(WOVariables.wo_webroot))
|
||||||
chars = ''.join(random.sample(string.ascii_letters, 8))
|
chars = ''.join(random.sample(string.ascii_letters, 8))
|
||||||
try:
|
try:
|
||||||
WOShellExec.cmd_exec(self, 'mysql < {0}22222/htdocs/db'
|
WOShellExec.cmd_exec(self, 'mysql < {0}22222/htdocs/db'
|
||||||
'/anemometer/install.sql'
|
'/anemometer/install.sql'
|
||||||
.format(WOVariables.wo_webroot))
|
.format(WOVariables.wo_webroot))
|
||||||
except CommandExecutionError as e:
|
except CommandExecutionError as e:
|
||||||
raise SiteError("Unable to import Anemometer database")
|
raise SiteError("Unable to import Anemometer database")
|
||||||
|
|
||||||
WOMysql.execute(self, 'grant select on'
|
WOMysql.execute(self, 'grant select on'
|
||||||
' *.* to \'anemometer\''
|
' *.* to \'anemometer\''
|
||||||
'@\'{0}\' IDENTIFIED'
|
'@\'{0}\' IDENTIFIED'
|
||||||
' BY \'{1}\''.format(self.app.config.get
|
' BY \'{1}\''.format(self.app.config.get
|
||||||
('mysql', 'grant-host'),
|
('mysql', 'grant-host'),
|
||||||
chars))
|
chars))
|
||||||
Log.debug(self, "grant all on slow-query-log.*"
|
Log.debug(self, "grant all on slow-query-log.*"
|
||||||
" to anemometer@root_user"
|
" to anemometer@root_user"
|
||||||
" IDENTIFIED BY password ")
|
" IDENTIFIED BY password ")
|
||||||
WOMysql.execute(self, 'grant all on slow_query_log.* to'
|
WOMysql.execute(self, 'grant all on slow_query_log.* to'
|
||||||
'\'anemometer\'@\'{0}\' IDENTIFIED'
|
'\'anemometer\'@\'{0}\' IDENTIFIED'
|
||||||
' BY \'{1}\''.format(self.app.config.get(
|
' BY \'{1}\''.format(self.app.config.get(
|
||||||
'mysql', 'grant-host'),
|
'mysql', 'grant-host'),
|
||||||
chars),
|
chars),
|
||||||
errormsg="cannot grant priviledges", log=False)
|
errormsg="cannot grant priviledges", log=False)
|
||||||
|
|
||||||
# Custom Anemometer configuration
|
# Custom Anemometer configuration
|
||||||
Log.debug(self, "configration Anemometer")
|
Log.debug(self, "configration Anemometer")
|
||||||
data = dict(host=WOVariables.wo_mysql_host, port='3306',
|
data = dict(host=WOVariables.wo_mysql_host, port='3306',
|
||||||
user='anemometer', password=chars)
|
user='anemometer', password=chars)
|
||||||
wo_anemometer = open('{0}22222/htdocs/db/anemometer'
|
wo_anemometer = open('{0}22222/htdocs/db/anemometer'
|
||||||
'/conf/config.inc.php'
|
'/conf/config.inc.php'
|
||||||
.format(WOVariables.wo_webroot),
|
.format(WOVariables.wo_webroot),
|
||||||
encoding='utf-8', mode='w')
|
encoding='utf-8', mode='w')
|
||||||
self.app.render((data), 'anemometer.mustache',
|
self.app.render((data), 'anemometer.mustache',
|
||||||
out=wo_anemometer)
|
out=wo_anemometer)
|
||||||
wo_anemometer.close()
|
wo_anemometer.close()
|
||||||
|
|
||||||
if any('/usr/bin/pt-query-advisor' == x[1]
|
if any('/usr/bin/pt-query-advisor' == x[1]
|
||||||
for x in packages):
|
for x in packages):
|
||||||
|
|||||||
Reference in New Issue
Block a user