diff --git a/plogical/CyberCPLogFileWriter.py b/plogical/CyberCPLogFileWriter.py index 6c97c8909..46bcacf8e 100755 --- a/plogical/CyberCPLogFileWriter.py +++ b/plogical/CyberCPLogFileWriter.py @@ -106,7 +106,5 @@ Subject: %s statusFile = open(tempStatusPath, 'a') statusFile.writelines(mesg + '\n') statusFile.close() - print((mesg + '\n')) except BaseException as msg: - CyberCPLogFileWriter.writeToFile(str(msg) + ' [statusWriter]') - #print str(msg) \ No newline at end of file + CyberCPLogFileWriter.writeToFile(str(msg) + ' [statusWriter]') \ No newline at end of file diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 4f405a441..a63950d61 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -900,16 +900,19 @@ $parameters = array( if self.dataLossCheck(finalPath, tempStatusPath) == 0: raise BaseException('Directory is not empty.') - command = 'composer global require joomlatools/console' - ProcessUtilities.outputExecutioner(command, externalApp, None, self.permPath) + ### Decide joomla console path import getpass if getpass.getuser() == 'root': + command = 'export COMPOSER_ALLOW_SUPERUSER=1;composer global require joomlatools/console' + ProcessUtilities.outputExecutioner(command, externalApp, None, self.permPath) joomlaPath = '/root/.config/composer/vendor/bin/joomla' else: - joomlaPath = '/home/%s/.composer/vendor/bin/joomla' % (self.masterDomain) + command = 'composer global require joomlatools/console' + ProcessUtilities.outputExecutioner(command, externalApp, None, self.permPath) + joomlaPath = '/home/%s/.config/composer/vendor/bin/joomla' % (self.masterDomain) ## Run the install command diff --git a/plogical/processUtilities.py b/plogical/processUtilities.py index cff46e6c5..ecdf55cb5 100755 --- a/plogical/processUtilities.py +++ b/plogical/processUtilities.py @@ -106,10 +106,13 @@ class ProcessUtilities(multi.Thread): try: if os.path.exists(ProcessUtilities.debugPath): logging.writeToFile(command) + + f = open(os.devnull, 'w') + if shell == False: - res = subprocess.call(shlex.split(command)) + res = subprocess.call(shlex.split(command), stdout=f, stderr=f) else: - res = subprocess.call(command, shell=shell) + res = subprocess.call(command, shell=shell, stdout=f, stderr=f) if res == 0: return 1