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

Method isServiceRunning

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

Source from the content-addressed store, hash-verified

168 pass
169class serviceOpsRedhat(serviceOps):
170 def isServiceRunning(self, servicename):
171 try:
172 o = bash("service " + servicename + " status")
173 if "running" in o.getStdout() or "start" in o.getStdout() or "Running" in o.getStdout():
174 return True
175 else:
176 return False
177 except:
178 return False
179
180 def stopService(self, servicename,force=False):
181 if self.isServiceRunning(servicename) or force:

Callers 5

stopServiceMethod · 0.95
startServiceMethod · 0.95
configMethod · 0.45
configMethod · 0.45
configMethod · 0.45

Calls 2

bashClass · 0.85
getStdoutMethod · 0.45

Tested by

no test coverage detected