centralized execution ph1

This commit is contained in:
usmannasir
2019-03-21 23:26:42 +05:00
parent b37907af85
commit 520bd2b797
57 changed files with 813 additions and 679 deletions

View File

@@ -24,7 +24,7 @@ class ServerStatusUtil:
@staticmethod
def executioner(command, statusFile):
try:
res = subprocess.call(shlex.split(command), stdout=statusFile, stderr=statusFile)
res = ProcessUtilities.executioner(shlex.split(command), stdout=statusFile, stderr=statusFile)
if res == 1:
return 0
else:
@@ -94,7 +94,7 @@ class ServerStatusUtil:
try:
command = 'chown -R lsadm:lsadm ' + confPath
subprocess.call(shlex.split(command))
ProcessUtilities.executioner(shlex.split(command))
except:
pass
@@ -172,7 +172,7 @@ class ServerStatusUtil:
FNULL = open(os.devnull, 'w')
command = "chown -R " + "lsadm" + ":" + "lsadm" + " " + vhostPath
cmd = shlex.split(command)
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
ProcessUtilities.executioner(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))
@@ -209,7 +209,7 @@ class ServerStatusUtil:
FNULL = open(os.devnull, 'w')
command = "chown -R " + "lsadm" + ":" + "lsadm" + " " + vhostPath
cmd = shlex.split(command)
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
ProcessUtilities.executioner(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))