refactoring: firewall model changed using ufw model (due to docker iussues)

This commit is contained in:
Domingo Dirutigliano
2023-09-29 16:10:28 +02:00
parent 2657428d6e
commit b11fa66909
8 changed files with 241 additions and 161 deletions

View File

@@ -1,5 +1,5 @@
class Service:
def __init__(self, service_id: str, active: bool, public_port: int, proxy_port: int, name: str, proto: str, ip_src: str, ip_dst:str):
def __init__(self, service_id: str, active: bool, public_port: int, proxy_port: int, name: str, proto: str, ip_src: str, ip_dst:str, **other):
self.service_id = service_id
self.active = active
self.public_port = public_port
@@ -11,13 +11,4 @@ class Service:
@classmethod
def from_dict(cls, var: dict):
return cls(
service_id=var["service_id"],
active=var["active"],
public_port=var["public_port"],
proxy_port=var["proxy_port"],
name=var["name"],
proto=var["proto"],
ip_src=var["ip_src"],
ip_dst=var["ip_dst"]
)
return cls(**var)