@@ -24,22 +24,22 @@ def start(self):
2424 if self .app .pargs .nginx :
2525 Log .debug (self , "nginx service start" )
2626 services = services + ['nginx' ]
27- elif self .app .pargs .php :
27+ if self .app .pargs .php :
2828 Log .debug (self , "php5-fpm service start" )
2929 services = services + ['php5-fpm' ]
30- elif self .app .pargs .mysql :
30+ if self .app .pargs .mysql :
3131 Log .debug (self , "mysql service start" )
3232 services = services + ['mysql' ]
33- elif self .app .pargs .postfix :
33+ if self .app .pargs .postfix :
3434 Log .debug (self , "postfix service start" )
3535 services = services + ['postfix' ]
36- elif self .app .pargs .memcache :
36+ if self .app .pargs .memcache :
3737 Log .debug (self , "memcached service start" )
3838 services = services + ['memcached' ]
39- elif self .app .pargs .dovecot :
39+ if self .app .pargs .dovecot :
4040 Log .debug (self , "dovecot service start" )
4141 services = services + ['dovecot' ]
42- else :
42+ if not services :
4343 Log .debug (self , "nginx,php5-fpm,mysql,postfix services start" )
4444 services = services + ['nginx' , 'php5-fpm' , 'mysql' , 'postfix' ]
4545 for service in services :
@@ -52,22 +52,22 @@ def stop(self):
5252 if self .app .pargs .nginx :
5353 Log .debug (self , "nginx service stop" )
5454 services = services + ['nginx' ]
55- elif self .app .pargs .php :
55+ if self .app .pargs .php :
5656 Log .debug (self , "php5-fpm service stop" )
5757 services = services + ['php5-fpm' ]
58- elif self .app .pargs .mysql :
58+ if self .app .pargs .mysql :
5959 Log .debug (self , "mysql service stop" )
6060 services = services + ['mysql' ]
61- elif self .app .pargs .postfix :
61+ if self .app .pargs .postfix :
6262 Log .debug (self , "postfix service stop" )
6363 services = services + ['postfix' ]
64- elif self .app .pargs .memcache :
64+ if self .app .pargs .memcache :
6565 Log .debug (self , "memcached service stop" )
6666 services = services + ['memcached' ]
67- elif self .app .pargs .dovecot :
67+ if self .app .pargs .dovecot :
6868 Log .debug (self , "dovecot service stop" )
6969 services = services + ['dovecot' ]
70- else :
70+ if not services :
7171 services = services + ['nginx' , 'php5-fpm' , 'mysql' , 'postfix' ]
7272 Log .debug (self , "nginx,php5-fpm,mysql,postfix services stop" )
7373 for service in services :
@@ -80,22 +80,22 @@ def restart(self):
8080 if self .app .pargs .nginx :
8181 Log .debug (self , "nginx service restart" )
8282 services = services + ['nginx' ]
83- elif self .app .pargs .php :
83+ if self .app .pargs .php :
8484 Log .debug (self , "php5-fpm service restart" )
8585 services = services + ['php5-fpm' ]
86- elif self .app .pargs .mysql :
86+ if self .app .pargs .mysql :
8787 Log .debug (self , "mysql service restart" )
8888 services = services + ['mysql' ]
89- elif self .app .pargs .postfix :
89+ if self .app .pargs .postfix :
9090 Log .debug (self , "postfix service restart" )
9191 services = services + ['postfix' ]
92- elif self .app .pargs .memcache :
92+ if self .app .pargs .memcache :
9393 Log .debug (self , "memcached service restart" )
9494 services = services + ['memcached' ]
95- elif self .app .pargs .dovecot :
95+ if self .app .pargs .dovecot :
9696 Log .debug (self , "dovecot service restart" )
9797 services = services + ['dovecot' ]
98- else :
98+ if not services :
9999 services = services + ['nginx' , 'php5-fpm' , 'mysql' , 'postfix' ]
100100 for service in services :
101101 Log .debug (self , "nginx,php5-fpm,mysql,postfix services restart" )
@@ -108,22 +108,22 @@ def status(self):
108108 if self .app .pargs .nginx :
109109 Log .debug (self , "nginx service status" )
110110 services = services + ['nginx' ]
111- elif self .app .pargs .php :
111+ if self .app .pargs .php :
112112 Log .debug (self , "php5-fpm service status" )
113113 services = services + ['php5-fpm' ]
114- elif self .app .pargs .mysql :
114+ if self .app .pargs .mysql :
115115 Log .debug (self , "mysql service status" )
116116 services = services + ['mysql' ]
117- elif self .app .pargs .postfix :
117+ if self .app .pargs .postfix :
118118 services = services + ['postfix' ]
119119 Log .debug (self , "postfix service status" )
120- elif self .app .pargs .memcache :
120+ if self .app .pargs .memcache :
121121 Log .debug (self , "memcached service status" )
122122 services = services + ['memcached' ]
123- elif self .app .pargs .dovecot :
123+ if self .app .pargs .dovecot :
124124 Log .debug (self , "dovecot service status" )
125125 services = services + ['dovecot' ]
126- else :
126+ if not services :
127127 Log .debug (self , "nginx,php5-fpm,mysql,postfix services status" )
128128 services = services + ['nginx' , 'php5-fpm' , 'mysql' , 'postfix' ]
129129 for service in services :
@@ -137,22 +137,22 @@ def reload(self):
137137 if self .app .pargs .nginx :
138138 Log .debug (self , "nginx service reload" )
139139 services = services + ['nginx' ]
140- elif self .app .pargs .php :
140+ if self .app .pargs .php :
141141 Log .debug (self , "php5-fpm service reload" )
142142 services = services + ['php5-fpm' ]
143- elif self .app .pargs .mysql :
143+ if self .app .pargs .mysql :
144144 Log .debug (self , "mysql service reload" )
145145 services = services + ['mysql' ]
146- elif self .app .pargs .postfix :
146+ if self .app .pargs .postfix :
147147 Log .debug (self , "postfix service reload" )
148148 services = services + ['postfix' ]
149- elif self .app .pargs .memcache :
149+ if self .app .pargs .memcache :
150150 Log .debug (self , "memcached service reload" )
151151 services = services + ['memcached' ]
152- elif self .app .pargs .dovecot :
152+ if self .app .pargs .dovecot :
153153 Log .debug (self , "dovecot service reload" )
154154 services = services + ['dovecot' ]
155- else :
155+ if not services :
156156 services = services + ['nginx' , 'php5-fpm' , 'mysql' , 'postfix' ]
157157 for service in services :
158158 Log .debug (self , "nginx,php5-fpm,mysql,postfix services reload" )
0 commit comments