resolve conflict between stable/p3

This commit is contained in:
Usman Nasir
2019-12-16 13:15:04 +05:00
5 changed files with 129 additions and 92 deletions

View File

@@ -88,9 +88,13 @@ class ProcessUtilities(multi.Thread):
logging.writeToFile(str(msg) + "[stopLitespeed]")
@staticmethod
def normalExecutioner(command):
def normalExecutioner(command, shell=False):
try:
res = subprocess.call(shlex.split(command))
if shell == False:
res = subprocess.call(shlex.split(command))
else:
res = subprocess.call(command, shell=shell)
if res == 0:
return 1
else:
@@ -207,10 +211,10 @@ class ProcessUtilities(multi.Thread):
return "0" + str(msg)
@staticmethod
def executioner(command, user=None):
def executioner(command, user=None, shell=False):
try:
if getpass.getuser() == 'root':
ProcessUtilities.normalExecutioner(command)
ProcessUtilities.normalExecutioner(command, shell)
return 1
ret = ProcessUtilities.sendCommand(command, user)
@@ -231,7 +235,7 @@ class ProcessUtilities(multi.Thread):
def outputExecutioner(command, user=None):
try:
if getpass.getuser() == 'root':
return subprocess.check_output(shlex.split(command).decode("utf-8"))
return subprocess.check_output(command, shell=True).decode("utf-8")
if type(command) == list:
command = " ".join(command)