diff --git a/plugins/docker/index.py b/plugins/docker/index.py index 252cd678b..7fa29f9c3 100755 --- a/plugins/docker/index.py +++ b/plugins/docker/index.py @@ -610,8 +610,8 @@ def getDockerCreateInfo(): def __release_port(port): from collections import namedtuple try: - import firewall_api - firewall_api.firewall_api().addAcceptPortArgs(port, 'docker', 'port') + from utils.firewall import Firewall as MwFirewall + MwFirewall.instance().addAcceptPort(port, 'docker', 'port') return port except Exception as e: return "Release failed {}".format(e) diff --git a/plugins/imail/index.py b/plugins/imail/index.py index 6fa0c4758..2a9177fd0 100755 --- a/plugins/imail/index.py +++ b/plugins/imail/index.py @@ -54,8 +54,8 @@ class App: def __release_port(self, port): from collections import namedtuple try: - import firewall_api - firewall_api.firewall_api().addAcceptPortArgs(port, 'IMail-Server', 'port') + from utils.firewall import Firewall as MwFirewall + MwFirewall.instance().addAcceptPort(port, 'IMail-Server', 'port') return port except Exception as e: return "Release failed {}".format(e) diff --git a/plugins/zabbix/index.py b/plugins/zabbix/index.py index 167c85669..7be515276 100755 --- a/plugins/zabbix/index.py +++ b/plugins/zabbix/index.py @@ -338,10 +338,10 @@ def initAgentConf(): def openPort(): try: - import firewall_api - firewall_api.firewall_api().addAcceptPortArgs('18888', 'zabbix-web', 'port') - firewall_api.firewall_api().addAcceptPortArgs('10051', 'zabbix-server', 'port') - firewall_api.firewall_api().addAcceptPortArgs('10050', 'zabbix-agent', 'port') + from utils.firewall import Firewall as MwFirewall + MwFirewall.instance().addAcceptPort('18888', 'zabbix-web', 'port') + MwFirewall.instance().addAcceptPort('10051', 'zabbix-server', 'port') + MwFirewall.instance().addAcceptPort('10050', 'zabbix-agent', 'port') return port except Exception as e: return "Release failed {}".format(e) diff --git a/plugins/zabbix_agent/index.py b/plugins/zabbix_agent/index.py index c015c1ecd..d87b1b689 100755 --- a/plugins/zabbix_agent/index.py +++ b/plugins/zabbix_agent/index.py @@ -132,8 +132,8 @@ def initDreplace(): def openPort(): try: - import firewall_api - firewall_api.firewall_api().addAcceptPortArgs('10050', 'zabbix-agent', 'port') + from utils.firewall import Firewall as MwFirewall + MwFirewall.instance().addAcceptPort('10050', 'zabbix-agent', 'port') return port except Exception as e: return "Release failed {}".format(e)