diff --git a/baseTemplate/views.py b/baseTemplate/views.py index 01c18de19..c14896d00 100755 --- a/baseTemplate/views.py +++ b/baseTemplate/views.py @@ -201,8 +201,12 @@ def upgrade(request): else: return ACLManager.loadErrorJson('fetchStatus', 0) - command = f'/usr/local/CyberPanel/bin/python /usr/local/CyberCP/plogical/upgrade.py "SoftUpgrade,{data["branchSelect"]}"' - ProcessUtilities.popenExecutioner(command) + from plogical.applicationInstaller import ApplicationInstaller + + extraArgs = {} + extraArgs['branchSelect'] = data["branchSelect"] + background = ApplicationInstaller('UpgradeCP', extraArgs) + background.start() adminData = {"upgrade": 1} json_data = json.dumps(adminData) diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 691453f16..3651fd932 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -84,10 +84,16 @@ def run(self): self.WPCreateBackup() elif self.installApp == 'RestoreWPbackupNow': self.RestoreWPbackupNow() + elif self.installApp == 'UpgradeCP': + self.UpgradeCP() except BaseException as msg: logging.writeToFile(str(msg) + ' [ApplicationInstaller.run]') + def UpgradeCP(self): + command = f'/usr/local/CyberPanel/bin/python /usr/local/CyberCP/plogical/upgrade.py "SoftUpgrade,{self.data["branchSelect"]}"' + ProcessUtilities.executioner(command) + def installMautic(self): try: