bug fix for ubuntu and docker manager

This commit is contained in:
Usman Nasir
2019-07-24 22:37:37 +05:00
parent 33ed372cec
commit 91c9c22f38
20 changed files with 156 additions and 90 deletions

View File

@@ -386,10 +386,14 @@ class FirewallManager:
FirewallUtilities.deleteRule("tcp", updateFW.port, "0.0.0.0/0")
updateFW.port = sshPort
updateFW.save()
FirewallUtilities.addRule('tcp', sshPort, "0.0.0.0/0")
except:
try:
newFireWallRule = FirewallRules(name="SSHCustom", port=sshPort, proto="tcp")
newFireWallRule.save()
FirewallUtilities.addRule('tcp', sshPort, "0.0.0.0/0")
command = 'firewall-cmd --permanent --remove-service=ssh'
ProcessUtilities.executioner(command)
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg))