From 1a1a57225ae8dfe8504f1bd5851691af96757b5f Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 31 Dec 2014 15:03:08 +0530 Subject: [PATCH] ee debug paramter done --- config/ee.conf | 2 +- ee/cli/plugins/debug.py | 73 +++++++++++++++++++++++++++++++++++++---- ee/cli/plugins/stack.py | 1 - 3 files changed, 67 insertions(+), 9 deletions(-) diff --git a/config/ee.conf b/config/ee.conf index dddf28f1..19994a86 100644 --- a/config/ee.conf +++ b/config/ee.conf @@ -40,7 +40,7 @@ [stack] - # ip-address = +ip-address = 1.1.1.1 2.2.2.2 3.3.3.3 4.4.4.4 [mysql] diff --git a/ee/cli/plugins/debug.py b/ee/cli/plugins/debug.py index 4ac9725a..5b97674a 100644 --- a/ee/cli/plugins/debug.py +++ b/ee/cli/plugins/debug.py @@ -36,25 +36,84 @@ class EEDebugController(CementBaseController): dict(help='Interactive debug', action='store_true')), ] + @expose(hide=True) + def debug_nginx(self): + if self.start: + print("Start Nginx debug") + debug_address = (self.app.config.get('stack', 'ip-address') + .split()) + print(debug_address) + else: + print("Stop Nginx debug") + + @expose(hide=True) + def debug_php(self): + if self.start: + print("Start PHP debug") + else: + print("Stop PHP debug") + + @expose(hide=True) + def debug_fpm(self): + if self.start: + print("Start FPM debug") + else: + print("Stop FPM debug") + + @expose(hide=True) + def debug_mysql(self): + if self.start: + print("Start MySQL debug") + else: + print("Stop MySQL debug") + + @expose(hide=True) + def debug_wp(self): + if self.start: + print("Start WP debug") + else: + print("Stop WP debug") + + @expose(hide=True) + def debug_rewrite(self): + if self.start: + print("Start WP-Rewrite debug") + else: + print("Stop WP-Rewrite debug") + @expose(hide=True) def default(self): self.start = True + self.interactive = False + if self.app.pargs.stop: self.start = False + + if ((not self.app.pargs.nginx) and (not self.app.pargs.php) + and (not self.app.pargs.fpm) and (not self.app.pargs.mysql) + and (not self.app.pargs.wp) and (not self.app.pargs.rewrite)): + self.debug_nginx() + self.debug_php() + self.debug_fpm() + self.debug_mysql() + self.debug_wp() + self.debug_rewrite() + if self.app.pargs.nginx: - pass + self.debug_nginx() if self.app.pargs.php: - pass + self.debug_php() if self.app.pargs.fpm: - pass + self.debug_fpm() if self.app.pargs.mysql: - pass + self.debug_mysql() if self.app.pargs.wp: - pass + self.debug_wp() if self.app.pargs.rewrite: - pass + self.debug_rewrite() + if self.app.pargs.interactive: - pass + self.interactive = True def load(app): diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index 7e0f5d63..cafe9a42 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -143,7 +143,6 @@ class EEStackController(CementBaseController): if set(EEVariables.ee_nginx).issubset(set(apt_packages)): # Nginx core configuration change using configparser nc = NginxConfig() - print('in nginx') self.app.log.debug('Loading file /etc/nginx/nginx.conf ') nc.loadf('/etc/nginx/nginx.conf') nc.set('worker_processes', 'auto')