From bf8de20ed5247b4ed64b0be8d9326c7ca4e710e0 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 13 Nov 2019 18:08:14 +0500 Subject: [PATCH] update the call function --- install/install.py | 13 ++++++++----- install/installCyberPanel.py | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/install/install.py b/install/install.py index 428a22f2f..6cd73b169 100755 --- a/install/install.py +++ b/install/install.py @@ -219,25 +219,28 @@ class preFlightsChecks: @staticmethod def call(command, distro, bracket, message, log=0, do_exit=0, code=os.EX_OK): - preFlightsChecks.stdOut(message + " " + bracket, log) + finalMessage = 'Running: %s' % (message) + preFlightsChecks.stdOut(finalMessage, log) count = 0 while True: res = subprocess.call(shlex.split(command)) if preFlightsChecks.resFailed(distro, res): count = count + 1 - preFlightsChecks.stdOut(message + " failed, trying again, try number: " + str(count)) + finalMessage = 'Running %s failed. Running again, try number %s' % (message, str(count)) + preFlightsChecks.stdOut(finalMessage) if count == 3: fatal_message = '' if do_exit: fatal_message = '. Fatal error, see /var/log/installLogs.txt for full details' - preFlightsChecks.stdOut("[ERROR] We are not able to " + message + ' return code: ' + str(res) + - fatal_message + " " + bracket, 1, do_exit, code) + preFlightsChecks.stdOut("[ERROR] We are not able to run " + message + ' return code: ' + str(res) + + fatal_message + ".", 1, do_exit, code) return False else: - preFlightsChecks.stdOut(message + ' successful', log) + preFlightsChecks.stdOut('%s ran successfully.' % (message), log) break + return True def checkIfSeLinuxDisabled(self): diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index d1be07dd7..2cf6d27b6 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -454,7 +454,7 @@ class InstallCyberPanel: os.remove('/etc/resolv.conf') except OSError as e1: InstallCyberPanel.stdOut("Unable to remove existing /etc/resolv.conf to install PowerDNS: " + - str(e1), 1, 1, os.EX_OSERR)+ + str(e1), 1, 1, os.EX_OSERR)