Skip to content

Commit f116bd0

Browse files
author
gau1991
committed
Improved MySQL check to detect while ee stack services
1 parent 245e455 commit f116bd0

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

ee/cli/plugins/stack_services.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ def stop(self):
115115
Log.info(self, "PHP5-FPM is not installed")
116116

117117
if self.app.pargs.mysql:
118-
if EEVariables.ee_mysql_host is "localhost":
118+
if (EEVariables.ee_mysql_host is "localhost" and
119+
(EEAptGet.is_installed(self, 'mysql-server') or
120+
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
121+
EEAptGet.is_installed(self, 'mariadb-server'))):
119122
services = services + ['mysql']
120123
else:
121124
Log.warn(self, "Remote MySQL found,"
@@ -179,7 +182,10 @@ def restart(self):
179182
Log.info(self, "PHP5-FPM is not installed")
180183

181184
if self.app.pargs.mysql:
182-
if EEVariables.ee_mysql_host is "localhost":
185+
if (EEVariables.ee_mysql_host is "localhost" and
186+
(EEAptGet.is_installed(self, 'mysql-server') or
187+
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
188+
EEAptGet.is_installed(self, 'mariadb-server'))):
183189
services = services + ['mysql']
184190
else:
185191
Log.warn(self, "Remote MySQL found,"
@@ -243,7 +249,10 @@ def status(self):
243249
Log.info(self, "PHP5-FPM is not installed")
244250

245251
if self.app.pargs.mysql:
246-
if EEVariables.ee_mysql_host is "localhost":
252+
if (EEVariables.ee_mysql_host is "localhost" and
253+
(EEAptGet.is_installed(self, 'mysql-server') or
254+
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
255+
EEAptGet.is_installed(self, 'mariadb-server'))):
247256
services = services + ['mysql']
248257
else:
249258
Log.warn(self, "Remote MySQL found,"
@@ -306,7 +315,10 @@ def reload(self):
306315
Log.info(self, "PHP5-FPM is not installed")
307316

308317
if self.app.pargs.mysql:
309-
if EEVariables.ee_mysql_host is "localhost":
318+
if (EEVariables.ee_mysql_host is "localhost" and
319+
(EEAptGet.is_installed(self, 'mysql-server') or
320+
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
321+
EEAptGet.is_installed(self, 'mariadb-server'))):
310322
services = services + ['mysql']
311323
else:
312324
Log.warn(self, "Remote MySQL found,"

0 commit comments

Comments
 (0)