Skip to content

Commit

Permalink
add command checking;
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Dec 22, 2023
1 parent 308af12 commit a0be5c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plogical/DockerSites.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def DeployWPContainer(self):
### WriteConfig to compose-file

command = f"mkdir -p /home/docker/{self.data['finalURL']}"
result, message = ProcessUtilities.outputExecutioner(command)
result, message = ProcessUtilities.outputExecutioner(command, None, None, None, 1)

if result == 0:
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
Expand All @@ -304,7 +304,7 @@ def DeployWPContainer(self):
WriteToFile.close()

command = f"mv {TempCompose} {self.data['ComposePath']}"
result, message = ProcessUtilities.outputExecutioner(command)
result, message = ProcessUtilities.outputExecutioner(command, None, None, None, 1)

if result == 0:
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
Expand All @@ -316,7 +316,7 @@ def DeployWPContainer(self):
####

command = f"docker-compose -f {self.data['ComposePath']} -p '{self.data['SiteName']}' up -d"
result, message = ProcessUtilities.outputExecutioner(command)
result, message = ProcessUtilities.outputExecutioner(command, None, None, None, 1)

if result == 0:
logging.statusWriter(self.JobID, f'Error {str(message)} . [404]')
Expand Down Expand Up @@ -345,7 +345,7 @@ def DeployWPContainer(self):
### just restart ls for htaccess

from plogical.installUtilities import installUtilities
installUtilities.reStartLiteSpeed()
installUtilities.reStartLiteSpeedSocket()

logging.statusWriter(self.JobID, 'Completed. [200]')

Expand Down
1 change: 1 addition & 0 deletions plogical/processUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ def outputExecutioner(command, user=None, shell = None, dir = None, retRequired
try:
if os.path.exists('/usr/local/CyberCP/debug'):
logging.writeToFile(command)

if getpass.getuser() == 'root':
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(command)
Expand Down

0 comments on commit a0be5c3

Please sign in to comment.