This commit is contained in:
Usman Nasir
2019-12-10 15:09:10 +05:00
parent d0dc397463
commit 5e7aeeb597
231 changed files with 1698 additions and 1697 deletions

View File

@@ -81,7 +81,7 @@ LoadModule mpm_event_module modules/mod_mpm_event.so
return 1
else:
return 0
except BaseException, msg:
except BaseException as msg:
message = "%s. [%s]" % (str(msg), '[ApacheController.checkIfApacheInstalled]')
logging.CyberCPLogFileWriter.writeToFile(message)
@@ -94,7 +94,7 @@ LoadModule mpm_event_module modules/mod_mpm_event.so
return 0
else:
return 1
except BaseException, msg:
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))
return 0
@@ -157,7 +157,7 @@ LoadModule mpm_event_module modules/mod_mpm_event.so
return 1
except BaseException, msg:
except BaseException as msg:
return str(msg)
@staticmethod
@@ -302,5 +302,5 @@ LoadModule mpm_event_module modules/mod_mpm_event.so
return [0,result]
return [1, 'None']
except BaseException, msg:
except BaseException as msg:
return [0, str(msg)]

View File

@@ -144,7 +144,7 @@ class ApacheVhost:
ProcessUtilities.normalExecutioner(command)
return [1, 'None']
except BaseException, msg:
except BaseException as msg:
return [0, str(msg)]
@staticmethod
@@ -172,7 +172,7 @@ class ApacheVhost:
confFile.close()
return [1, 'None']
except BaseException, msg:
except BaseException as msg:
return [0, str(msg)]
@staticmethod
@@ -183,7 +183,7 @@ class ApacheVhost:
confFile.write("REWRITERULE ^(.*)$ HTTP://apachebackend/$1 [P]")
confFile.close()
return [1, 'None']
except BaseException, msg:
except BaseException as msg:
return [0, str(msg)]
@staticmethod
@@ -256,7 +256,7 @@ class ApacheVhost:
ProcessUtilities.normalExecutioner(command)
return [1, 'None']
except BaseException, msg:
except BaseException as msg:
return [0, str(msg)]
@staticmethod
@@ -285,7 +285,7 @@ class ApacheVhost:
command = "systemctl restart httpd"
ProcessUtilities.normalExecutioner(command)
except BaseException, msg:
except BaseException as msg:
logging.writeToFile(str(msg))
@staticmethod
@@ -300,7 +300,7 @@ class ApacheVhost:
confFile.write(currentConf)
confFile.close()
except BaseException, msg:
except BaseException as msg:
logging.writeToFile(
str(msg) + " [IO Error with per host config file [ApacheVhosts.perHostVirtualConf]]")
@@ -383,6 +383,6 @@ class ApacheVhost:
ProcessUtilities.normalExecutioner(command)
return 1
except BaseException, msg:
except BaseException as msg:
logging.writeToFile(str(msg))
return 1

View File

@@ -14,7 +14,7 @@ class BackupUtil:
return 1
else:
return 0
except BaseException, msg:
except BaseException as msg:
return 0
@staticmethod
@@ -25,9 +25,9 @@ class BackupUtil:
try:
smtpObj = smtplib.SMTP('127.0.0.1')
smtpObj.sendmail(sender, receivers, message)
print "Successfully sent email"
except BaseException, msg:
print "Error: unable to send email %s" % str(msg)
print("Successfully sent email")
except BaseException as msg:
print("Error: unable to send email %s" % str(msg))
@staticmethod
def SyncHome():