1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

ifupdown2: mstpctl: check mstpd running just once during init of mstpctl modules

Ticket: CM-8035
Reviewed By: wkok
Testing Done: Tested mstp commands in interfaces file

(cherry picked from commit 2c3471f2082c8adbdcc395cbd0066680f280b9e5)
This commit is contained in:
Roopa Prabhu
2015-11-27 19:31:25 -08:00
committed by Sam Tannous
parent eca54a3e5a
commit 5f8c03e7a1
2 changed files with 17 additions and 4 deletions

View File

@@ -42,3 +42,15 @@ class systemUtils():
# XXX: check for subprocess errors vs os error
return False
return True
@classmethod
def is_process_running(self, processname):
if not processname:
return False
utilsobj = utilsBase()
try:
utilsobj.exec_command('/bin/pidof %s' %processname)
except:
return False
else:
return True