MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / test_port

Method test_port

class/plugin_deployment.py:1078–1095  ·  view source on GitHub ↗
(self, server_port)

Source from the content-addressed store, hash-verified

1076
1077 # 检查端口是否放行 没有则放行防火墙
1078 def test_port(self, server_port):
1079 from safeModel.firewallModel import main
1080
1081 firewall = main()
1082 rules = firewall.get_sys_firewall_rules()
1083 for r in rules:
1084 if r["types"] == "accept" and r["ports"] == server_port and r["protocol"].find("tcp") != -1:
1085 return
1086 new_get = public.dict_obj()
1087 new_get.protocol = "tcp"
1088 new_get.ports = server_port
1089 new_get.choose = "all"
1090 new_get.address = ""
1091 new_get.domain = ""
1092 new_get.types = "accept"
1093 new_get.brief = ""
1094 new_get.source = ""
1095 firewall.create_rules(new_get)
1096
1097 # 环境类前置检查 mysql ftp redis
1098 def check_project_env(self, get):

Callers 1

start_java_projectMethod · 0.95

Calls 4

mainClass · 0.90
create_rulesMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected