MCPcopy Create free account
hub / github.com/apache/cloudstack / isServiceRunning

Method isServiceRunning

python/lib/cloudutils/utilities.py:206–214  ·  view source on GitHub ↗
(self, servicename)

Source from the content-addressed store, hash-verified

204
205class serviceOpsUbuntu(serviceOps):
206 def isServiceRunning(self, servicename):
207 try:
208 o = bash("sudo /usr/sbin/service " + servicename + " status")
209 if "not running" in o.getStdout():
210 return False
211 else:
212 return True
213 except:
214 return False
215
216 def stopService(self, servicename,force=True):
217 if self.isServiceRunning(servicename) or force:

Callers 2

stopServiceMethod · 0.95
startServiceMethod · 0.95

Calls 2

bashClass · 0.85
getStdoutMethod · 0.45

Tested by

no test coverage detected