daemon: updating core.configservice and core.configservices to avoid deprecated type hinting
This commit is contained in:
parent
e770bcd47c
commit
3d722a7721
8 changed files with 345 additions and 346 deletions
|
@ -1,5 +1,5 @@
|
|||
import abc
|
||||
from typing import Any, Dict, List
|
||||
from typing import Any
|
||||
|
||||
from core.config import Configuration
|
||||
from core.configservice.base import ConfigService, ConfigServiceMode
|
||||
|
@ -82,23 +82,23 @@ def rj45_check(iface: CoreInterface) -> bool:
|
|||
class FRRZebra(ConfigService):
|
||||
name: str = "FRRzebra"
|
||||
group: str = GROUP
|
||||
directories: List[str] = ["/usr/local/etc/frr", "/var/run/frr", "/var/log/frr"]
|
||||
files: List[str] = [
|
||||
directories: list[str] = ["/usr/local/etc/frr", "/var/run/frr", "/var/log/frr"]
|
||||
files: list[str] = [
|
||||
"/usr/local/etc/frr/frr.conf",
|
||||
"frrboot.sh",
|
||||
"/usr/local/etc/frr/vtysh.conf",
|
||||
"/usr/local/etc/frr/daemons",
|
||||
]
|
||||
executables: List[str] = ["zebra"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash frrboot.sh zebra"]
|
||||
validate: List[str] = ["pidof zebra"]
|
||||
shutdown: List[str] = ["killall zebra"]
|
||||
executables: list[str] = ["zebra"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash frrboot.sh zebra"]
|
||||
validate: list[str] = ["pidof zebra"]
|
||||
shutdown: list[str] = ["killall zebra"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
frr_conf = self.files[0]
|
||||
frr_bin_search = self.node.session.options.get(
|
||||
"frr_bin_search", default="/usr/local/bin /usr/bin /usr/lib/frr"
|
||||
|
@ -145,16 +145,16 @@ class FRRZebra(ConfigService):
|
|||
|
||||
class FrrService(abc.ABC):
|
||||
group: str = GROUP
|
||||
directories: List[str] = []
|
||||
files: List[str] = []
|
||||
executables: List[str] = []
|
||||
dependencies: List[str] = ["FRRzebra"]
|
||||
startup: List[str] = []
|
||||
validate: List[str] = []
|
||||
shutdown: List[str] = []
|
||||
directories: list[str] = []
|
||||
files: list[str] = []
|
||||
executables: list[str] = []
|
||||
dependencies: list[str] = ["FRRzebra"]
|
||||
startup: list[str] = []
|
||||
validate: list[str] = []
|
||||
shutdown: list[str] = []
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
ipv4_routing: bool = False
|
||||
ipv6_routing: bool = False
|
||||
|
||||
|
@ -175,8 +175,8 @@ class FRROspfv2(FrrService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "FRROSPFv2"
|
||||
shutdown: List[str] = ["killall ospfd"]
|
||||
validate: List[str] = ["pidof ospfd"]
|
||||
shutdown: list[str] = ["killall ospfd"]
|
||||
validate: list[str] = ["pidof ospfd"]
|
||||
ipv4_routing: bool = True
|
||||
|
||||
def frr_config(self) -> str:
|
||||
|
@ -227,8 +227,8 @@ class FRROspfv3(FrrService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "FRROSPFv3"
|
||||
shutdown: List[str] = ["killall ospf6d"]
|
||||
validate: List[str] = ["pidof ospf6d"]
|
||||
shutdown: list[str] = ["killall ospf6d"]
|
||||
validate: list[str] = ["pidof ospf6d"]
|
||||
ipv4_routing: bool = True
|
||||
ipv6_routing: bool = True
|
||||
|
||||
|
@ -264,8 +264,8 @@ class FRRBgp(FrrService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "FRRBGP"
|
||||
shutdown: List[str] = ["killall bgpd"]
|
||||
validate: List[str] = ["pidof bgpd"]
|
||||
shutdown: list[str] = ["killall bgpd"]
|
||||
validate: list[str] = ["pidof bgpd"]
|
||||
custom_needed: bool = True
|
||||
ipv4_routing: bool = True
|
||||
ipv6_routing: bool = True
|
||||
|
@ -294,8 +294,8 @@ class FRRRip(FrrService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "FRRRIP"
|
||||
shutdown: List[str] = ["killall ripd"]
|
||||
validate: List[str] = ["pidof ripd"]
|
||||
shutdown: list[str] = ["killall ripd"]
|
||||
validate: list[str] = ["pidof ripd"]
|
||||
ipv4_routing: bool = True
|
||||
|
||||
def frr_config(self) -> str:
|
||||
|
@ -319,8 +319,8 @@ class FRRRipng(FrrService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "FRRRIPNG"
|
||||
shutdown: List[str] = ["killall ripngd"]
|
||||
validate: List[str] = ["pidof ripngd"]
|
||||
shutdown: list[str] = ["killall ripngd"]
|
||||
validate: list[str] = ["pidof ripngd"]
|
||||
ipv6_routing: bool = True
|
||||
|
||||
def frr_config(self) -> str:
|
||||
|
@ -345,8 +345,8 @@ class FRRBabel(FrrService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "FRRBabel"
|
||||
shutdown: List[str] = ["killall babeld"]
|
||||
validate: List[str] = ["pidof babeld"]
|
||||
shutdown: list[str] = ["killall babeld"]
|
||||
validate: list[str] = ["pidof babeld"]
|
||||
ipv6_routing: bool = True
|
||||
|
||||
def frr_config(self) -> str:
|
||||
|
@ -385,8 +385,8 @@ class FRRpimd(FrrService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "FRRpimd"
|
||||
shutdown: List[str] = ["killall pimd"]
|
||||
validate: List[str] = ["pidof pimd"]
|
||||
shutdown: list[str] = ["killall pimd"]
|
||||
validate: list[str] = ["pidof pimd"]
|
||||
ipv4_routing: bool = True
|
||||
|
||||
def frr_config(self) -> str:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Any, Dict, List
|
||||
from typing import Any
|
||||
|
||||
from core import utils
|
||||
from core.config import Configuration
|
||||
|
@ -10,18 +10,18 @@ GROUP: str = "ProtoSvc"
|
|||
class MgenSinkService(ConfigService):
|
||||
name: str = "MGEN_Sink"
|
||||
group: str = GROUP
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["mgensink.sh", "sink.mgen"]
|
||||
executables: List[str] = ["mgen"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash mgensink.sh"]
|
||||
validate: List[str] = ["pidof mgen"]
|
||||
shutdown: List[str] = ["killall mgen"]
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["mgensink.sh", "sink.mgen"]
|
||||
executables: list[str] = ["mgen"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash mgensink.sh"]
|
||||
validate: list[str] = ["pidof mgen"]
|
||||
shutdown: list[str] = ["killall mgen"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
ifnames = []
|
||||
for iface in self.node.get_ifaces():
|
||||
name = utils.sysctl_devname(iface.name)
|
||||
|
@ -32,18 +32,18 @@ class MgenSinkService(ConfigService):
|
|||
class NrlNhdp(ConfigService):
|
||||
name: str = "NHDP"
|
||||
group: str = GROUP
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["nrlnhdp.sh"]
|
||||
executables: List[str] = ["nrlnhdp"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash nrlnhdp.sh"]
|
||||
validate: List[str] = ["pidof nrlnhdp"]
|
||||
shutdown: List[str] = ["killall nrlnhdp"]
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["nrlnhdp.sh"]
|
||||
executables: list[str] = ["nrlnhdp"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash nrlnhdp.sh"]
|
||||
validate: list[str] = ["pidof nrlnhdp"]
|
||||
shutdown: list[str] = ["killall nrlnhdp"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
has_smf = "SMF" in self.node.config_services
|
||||
ifnames = []
|
||||
for iface in self.node.get_ifaces(control=False):
|
||||
|
@ -54,18 +54,18 @@ class NrlNhdp(ConfigService):
|
|||
class NrlSmf(ConfigService):
|
||||
name: str = "SMF"
|
||||
group: str = GROUP
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["startsmf.sh"]
|
||||
executables: List[str] = ["nrlsmf", "killall"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash startsmf.sh"]
|
||||
validate: List[str] = ["pidof nrlsmf"]
|
||||
shutdown: List[str] = ["killall nrlsmf"]
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["startsmf.sh"]
|
||||
executables: list[str] = ["nrlsmf", "killall"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash startsmf.sh"]
|
||||
validate: list[str] = ["pidof nrlsmf"]
|
||||
shutdown: list[str] = ["killall nrlsmf"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
has_nhdp = "NHDP" in self.node.config_services
|
||||
has_olsr = "OLSR" in self.node.config_services
|
||||
ifnames = []
|
||||
|
@ -84,18 +84,18 @@ class NrlSmf(ConfigService):
|
|||
class NrlOlsr(ConfigService):
|
||||
name: str = "OLSR"
|
||||
group: str = GROUP
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["nrlolsrd.sh"]
|
||||
executables: List[str] = ["nrlolsrd"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash nrlolsrd.sh"]
|
||||
validate: List[str] = ["pidof nrlolsrd"]
|
||||
shutdown: List[str] = ["killall nrlolsrd"]
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["nrlolsrd.sh"]
|
||||
executables: list[str] = ["nrlolsrd"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash nrlolsrd.sh"]
|
||||
validate: list[str] = ["pidof nrlolsrd"]
|
||||
shutdown: list[str] = ["killall nrlolsrd"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
has_smf = "SMF" in self.node.config_services
|
||||
has_zebra = "zebra" in self.node.config_services
|
||||
ifname = None
|
||||
|
@ -108,18 +108,18 @@ class NrlOlsr(ConfigService):
|
|||
class NrlOlsrv2(ConfigService):
|
||||
name: str = "OLSRv2"
|
||||
group: str = GROUP
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["nrlolsrv2.sh"]
|
||||
executables: List[str] = ["nrlolsrv2"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash nrlolsrv2.sh"]
|
||||
validate: List[str] = ["pidof nrlolsrv2"]
|
||||
shutdown: List[str] = ["killall nrlolsrv2"]
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["nrlolsrv2.sh"]
|
||||
executables: list[str] = ["nrlolsrv2"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash nrlolsrv2.sh"]
|
||||
validate: list[str] = ["pidof nrlolsrv2"]
|
||||
shutdown: list[str] = ["killall nrlolsrv2"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
has_smf = "SMF" in self.node.config_services
|
||||
ifnames = []
|
||||
for iface in self.node.get_ifaces(control=False):
|
||||
|
@ -130,18 +130,18 @@ class NrlOlsrv2(ConfigService):
|
|||
class OlsrOrg(ConfigService):
|
||||
name: str = "OLSRORG"
|
||||
group: str = GROUP
|
||||
directories: List[str] = ["/etc/olsrd"]
|
||||
files: List[str] = ["olsrd.sh", "/etc/olsrd/olsrd.conf"]
|
||||
executables: List[str] = ["olsrd"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash olsrd.sh"]
|
||||
validate: List[str] = ["pidof olsrd"]
|
||||
shutdown: List[str] = ["killall olsrd"]
|
||||
directories: list[str] = ["/etc/olsrd"]
|
||||
files: list[str] = ["olsrd.sh", "/etc/olsrd/olsrd.conf"]
|
||||
executables: list[str] = ["olsrd"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash olsrd.sh"]
|
||||
validate: list[str] = ["pidof olsrd"]
|
||||
shutdown: list[str] = ["killall olsrd"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
has_smf = "SMF" in self.node.config_services
|
||||
ifnames = []
|
||||
for iface in self.node.get_ifaces(control=False):
|
||||
|
@ -152,13 +152,13 @@ class OlsrOrg(ConfigService):
|
|||
class MgenActor(ConfigService):
|
||||
name: str = "MgenActor"
|
||||
group: str = GROUP
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["start_mgen_actor.sh"]
|
||||
executables: List[str] = ["mgen"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash start_mgen_actor.sh"]
|
||||
validate: List[str] = ["pidof mgen"]
|
||||
shutdown: List[str] = ["killall mgen"]
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["start_mgen_actor.sh"]
|
||||
executables: list[str] = ["mgen"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash start_mgen_actor.sh"]
|
||||
validate: list[str] = ["pidof mgen"]
|
||||
shutdown: list[str] = ["killall mgen"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import abc
|
||||
import logging
|
||||
from typing import Any, Dict, List
|
||||
from typing import Any
|
||||
|
||||
from core.config import Configuration
|
||||
from core.configservice.base import ConfigService, ConfigServiceMode
|
||||
|
@ -84,22 +84,22 @@ def rj45_check(iface: CoreInterface) -> bool:
|
|||
class Zebra(ConfigService):
|
||||
name: str = "zebra"
|
||||
group: str = GROUP
|
||||
directories: List[str] = ["/usr/local/etc/quagga", "/var/run/quagga"]
|
||||
files: List[str] = [
|
||||
directories: list[str] = ["/usr/local/etc/quagga", "/var/run/quagga"]
|
||||
files: list[str] = [
|
||||
"/usr/local/etc/quagga/Quagga.conf",
|
||||
"quaggaboot.sh",
|
||||
"/usr/local/etc/quagga/vtysh.conf",
|
||||
]
|
||||
executables: List[str] = ["zebra"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash quaggaboot.sh zebra"]
|
||||
validate: List[str] = ["pidof zebra"]
|
||||
shutdown: List[str] = ["killall zebra"]
|
||||
executables: list[str] = ["zebra"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash quaggaboot.sh zebra"]
|
||||
validate: list[str] = ["pidof zebra"]
|
||||
shutdown: list[str] = ["killall zebra"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
quagga_bin_search = self.node.session.options.get(
|
||||
"quagga_bin_search", default="/usr/local/bin /usr/bin /usr/lib/quagga"
|
||||
).strip('"')
|
||||
|
@ -153,16 +153,16 @@ class Zebra(ConfigService):
|
|||
|
||||
class QuaggaService(abc.ABC):
|
||||
group: str = GROUP
|
||||
directories: List[str] = []
|
||||
files: List[str] = []
|
||||
executables: List[str] = []
|
||||
dependencies: List[str] = ["zebra"]
|
||||
startup: List[str] = []
|
||||
validate: List[str] = []
|
||||
shutdown: List[str] = []
|
||||
directories: list[str] = []
|
||||
files: list[str] = []
|
||||
executables: list[str] = []
|
||||
dependencies: list[str] = ["zebra"]
|
||||
startup: list[str] = []
|
||||
validate: list[str] = []
|
||||
shutdown: list[str] = []
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
ipv4_routing: bool = False
|
||||
ipv6_routing: bool = False
|
||||
|
||||
|
@ -183,8 +183,8 @@ class Ospfv2(QuaggaService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "OSPFv2"
|
||||
validate: List[str] = ["pidof ospfd"]
|
||||
shutdown: List[str] = ["killall ospfd"]
|
||||
validate: list[str] = ["pidof ospfd"]
|
||||
shutdown: list[str] = ["killall ospfd"]
|
||||
ipv4_routing: bool = True
|
||||
|
||||
def quagga_iface_config(self, iface: CoreInterface) -> str:
|
||||
|
@ -234,8 +234,8 @@ class Ospfv3(QuaggaService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "OSPFv3"
|
||||
shutdown: List[str] = ["killall ospf6d"]
|
||||
validate: List[str] = ["pidof ospf6d"]
|
||||
shutdown: list[str] = ["killall ospf6d"]
|
||||
validate: list[str] = ["pidof ospf6d"]
|
||||
ipv4_routing: bool = True
|
||||
ipv6_routing: bool = True
|
||||
|
||||
|
@ -300,8 +300,8 @@ class Bgp(QuaggaService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "BGP"
|
||||
shutdown: List[str] = ["killall bgpd"]
|
||||
validate: List[str] = ["pidof bgpd"]
|
||||
shutdown: list[str] = ["killall bgpd"]
|
||||
validate: list[str] = ["pidof bgpd"]
|
||||
ipv4_routing: bool = True
|
||||
ipv6_routing: bool = True
|
||||
|
||||
|
@ -329,8 +329,8 @@ class Rip(QuaggaService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "RIP"
|
||||
shutdown: List[str] = ["killall ripd"]
|
||||
validate: List[str] = ["pidof ripd"]
|
||||
shutdown: list[str] = ["killall ripd"]
|
||||
validate: list[str] = ["pidof ripd"]
|
||||
ipv4_routing: bool = True
|
||||
|
||||
def quagga_config(self) -> str:
|
||||
|
@ -354,8 +354,8 @@ class Ripng(QuaggaService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "RIPNG"
|
||||
shutdown: List[str] = ["killall ripngd"]
|
||||
validate: List[str] = ["pidof ripngd"]
|
||||
shutdown: list[str] = ["killall ripngd"]
|
||||
validate: list[str] = ["pidof ripngd"]
|
||||
ipv6_routing: bool = True
|
||||
|
||||
def quagga_config(self) -> str:
|
||||
|
@ -380,8 +380,8 @@ class Babel(QuaggaService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "Babel"
|
||||
shutdown: List[str] = ["killall babeld"]
|
||||
validate: List[str] = ["pidof babeld"]
|
||||
shutdown: list[str] = ["killall babeld"]
|
||||
validate: list[str] = ["pidof babeld"]
|
||||
ipv6_routing: bool = True
|
||||
|
||||
def quagga_config(self) -> str:
|
||||
|
@ -420,8 +420,8 @@ class Xpimd(QuaggaService, ConfigService):
|
|||
"""
|
||||
|
||||
name: str = "Xpimd"
|
||||
shutdown: List[str] = ["killall xpimd"]
|
||||
validate: List[str] = ["pidof xpimd"]
|
||||
shutdown: list[str] = ["killall xpimd"]
|
||||
validate: list[str] = ["pidof xpimd"]
|
||||
ipv4_routing: bool = True
|
||||
|
||||
def quagga_config(self) -> str:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Any, Dict, List
|
||||
from typing import Any
|
||||
|
||||
from core.config import ConfigString, Configuration
|
||||
from core.configservice.base import ConfigService, ConfigServiceMode
|
||||
|
@ -9,41 +9,41 @@ GROUP_NAME: str = "Security"
|
|||
class VpnClient(ConfigService):
|
||||
name: str = "VPNClient"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["vpnclient.sh"]
|
||||
executables: List[str] = ["openvpn", "ip", "killall"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash vpnclient.sh"]
|
||||
validate: List[str] = ["pidof openvpn"]
|
||||
shutdown: List[str] = ["killall openvpn"]
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["vpnclient.sh"]
|
||||
executables: list[str] = ["openvpn", "ip", "killall"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash vpnclient.sh"]
|
||||
validate: list[str] = ["pidof openvpn"]
|
||||
shutdown: list[str] = ["killall openvpn"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = [
|
||||
default_configs: list[Configuration] = [
|
||||
ConfigString(id="keydir", label="Key Dir", default="/etc/core/keys"),
|
||||
ConfigString(id="keyname", label="Key Name", default="client1"),
|
||||
ConfigString(id="server", label="Server", default="10.0.2.10"),
|
||||
]
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
|
||||
class VpnServer(ConfigService):
|
||||
name: str = "VPNServer"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["vpnserver.sh"]
|
||||
executables: List[str] = ["openvpn", "ip", "killall"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash vpnserver.sh"]
|
||||
validate: List[str] = ["pidof openvpn"]
|
||||
shutdown: List[str] = ["killall openvpn"]
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["vpnserver.sh"]
|
||||
executables: list[str] = ["openvpn", "ip", "killall"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash vpnserver.sh"]
|
||||
validate: list[str] = ["pidof openvpn"]
|
||||
shutdown: list[str] = ["killall openvpn"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = [
|
||||
default_configs: list[Configuration] = [
|
||||
ConfigString(id="keydir", label="Key Dir", default="/etc/core/keys"),
|
||||
ConfigString(id="keyname", label="Key Name", default="server"),
|
||||
ConfigString(id="subnet", label="Subnet", default="10.0.200.0"),
|
||||
]
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
address = None
|
||||
for iface in self.node.get_ifaces(control=False):
|
||||
ip4 = iface.get_ip4()
|
||||
|
@ -56,48 +56,48 @@ class VpnServer(ConfigService):
|
|||
class IPsec(ConfigService):
|
||||
name: str = "IPsec"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["ipsec.sh"]
|
||||
executables: List[str] = ["racoon", "ip", "setkey", "killall"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash ipsec.sh"]
|
||||
validate: List[str] = ["pidof racoon"]
|
||||
shutdown: List[str] = ["killall racoon"]
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["ipsec.sh"]
|
||||
executables: list[str] = ["racoon", "ip", "setkey", "killall"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash ipsec.sh"]
|
||||
validate: list[str] = ["pidof racoon"]
|
||||
shutdown: list[str] = ["killall racoon"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
|
||||
class Firewall(ConfigService):
|
||||
name: str = "Firewall"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["firewall.sh"]
|
||||
executables: List[str] = ["iptables"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash firewall.sh"]
|
||||
validate: List[str] = []
|
||||
shutdown: List[str] = []
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["firewall.sh"]
|
||||
executables: list[str] = ["iptables"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash firewall.sh"]
|
||||
validate: list[str] = []
|
||||
shutdown: list[str] = []
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
|
||||
class Nat(ConfigService):
|
||||
name: str = "NAT"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["nat.sh"]
|
||||
executables: List[str] = ["iptables"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash nat.sh"]
|
||||
validate: List[str] = []
|
||||
shutdown: List[str] = []
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["nat.sh"]
|
||||
executables: list[str] = ["iptables"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash nat.sh"]
|
||||
validate: list[str] = []
|
||||
shutdown: list[str] = []
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
ifnames = []
|
||||
for iface in self.node.get_ifaces(control=False):
|
||||
ifnames.append(iface.name)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from typing import Any, Dict, List
|
||||
from typing import Any
|
||||
|
||||
import netaddr
|
||||
|
||||
|
@ -12,18 +12,18 @@ GROUP_NAME = "Utility"
|
|||
class DefaultRouteService(ConfigService):
|
||||
name: str = "DefaultRoute"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["defaultroute.sh"]
|
||||
executables: List[str] = ["ip"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash defaultroute.sh"]
|
||||
validate: List[str] = []
|
||||
shutdown: List[str] = []
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["defaultroute.sh"]
|
||||
executables: list[str] = ["ip"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash defaultroute.sh"]
|
||||
validate: list[str] = []
|
||||
shutdown: list[str] = []
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
# only add default routes for linked routing nodes
|
||||
routes = []
|
||||
ifaces = self.node.get_ifaces()
|
||||
|
@ -40,18 +40,18 @@ class DefaultRouteService(ConfigService):
|
|||
class DefaultMulticastRouteService(ConfigService):
|
||||
name: str = "DefaultMulticastRoute"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["defaultmroute.sh"]
|
||||
executables: List[str] = []
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash defaultmroute.sh"]
|
||||
validate: List[str] = []
|
||||
shutdown: List[str] = []
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["defaultmroute.sh"]
|
||||
executables: list[str] = []
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash defaultmroute.sh"]
|
||||
validate: list[str] = []
|
||||
shutdown: list[str] = []
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
ifname = None
|
||||
for iface in self.node.get_ifaces(control=False):
|
||||
ifname = iface.name
|
||||
|
@ -62,18 +62,18 @@ class DefaultMulticastRouteService(ConfigService):
|
|||
class StaticRouteService(ConfigService):
|
||||
name: str = "StaticRoute"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["staticroute.sh"]
|
||||
executables: List[str] = []
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash staticroute.sh"]
|
||||
validate: List[str] = []
|
||||
shutdown: List[str] = []
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["staticroute.sh"]
|
||||
executables: list[str] = []
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash staticroute.sh"]
|
||||
validate: list[str] = []
|
||||
shutdown: list[str] = []
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
routes = []
|
||||
for iface in self.node.get_ifaces(control=False):
|
||||
for ip in iface.ips():
|
||||
|
@ -90,18 +90,18 @@ class StaticRouteService(ConfigService):
|
|||
class IpForwardService(ConfigService):
|
||||
name: str = "IPForward"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["ipforward.sh"]
|
||||
executables: List[str] = ["sysctl"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash ipforward.sh"]
|
||||
validate: List[str] = []
|
||||
shutdown: List[str] = []
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["ipforward.sh"]
|
||||
executables: list[str] = ["sysctl"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash ipforward.sh"]
|
||||
validate: list[str] = []
|
||||
shutdown: list[str] = []
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
devnames = []
|
||||
for iface in self.node.get_ifaces():
|
||||
devname = utils.sysctl_devname(iface.name)
|
||||
|
@ -112,18 +112,18 @@ class IpForwardService(ConfigService):
|
|||
class SshService(ConfigService):
|
||||
name: str = "SSH"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = ["/etc/ssh", "/var/run/sshd"]
|
||||
files: List[str] = ["startsshd.sh", "/etc/ssh/sshd_config"]
|
||||
executables: List[str] = ["sshd"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash startsshd.sh"]
|
||||
validate: List[str] = []
|
||||
shutdown: List[str] = ["killall sshd"]
|
||||
directories: list[str] = ["/etc/ssh", "/var/run/sshd"]
|
||||
files: list[str] = ["startsshd.sh", "/etc/ssh/sshd_config"]
|
||||
executables: list[str] = ["sshd"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash startsshd.sh"]
|
||||
validate: list[str] = []
|
||||
shutdown: list[str] = ["killall sshd"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
return dict(
|
||||
sshcfgdir=self.directories[0],
|
||||
sshstatedir=self.directories[1],
|
||||
|
@ -134,18 +134,18 @@ class SshService(ConfigService):
|
|||
class DhcpService(ConfigService):
|
||||
name: str = "DHCP"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = ["/etc/dhcp", "/var/lib/dhcp"]
|
||||
files: List[str] = ["/etc/dhcp/dhcpd.conf"]
|
||||
executables: List[str] = ["dhcpd"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["touch /var/lib/dhcp/dhcpd.leases", "dhcpd"]
|
||||
validate: List[str] = ["pidof dhcpd"]
|
||||
shutdown: List[str] = ["killall dhcpd"]
|
||||
directories: list[str] = ["/etc/dhcp", "/var/lib/dhcp"]
|
||||
files: list[str] = ["/etc/dhcp/dhcpd.conf"]
|
||||
executables: list[str] = ["dhcpd"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["touch /var/lib/dhcp/dhcpd.leases", "dhcpd"]
|
||||
validate: list[str] = ["pidof dhcpd"]
|
||||
shutdown: list[str] = ["killall dhcpd"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
subnets = []
|
||||
for iface in self.node.get_ifaces(control=False):
|
||||
for ip4 in iface.ip4s:
|
||||
|
@ -162,18 +162,18 @@ class DhcpService(ConfigService):
|
|||
class DhcpClientService(ConfigService):
|
||||
name: str = "DHCPClient"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["startdhcpclient.sh"]
|
||||
executables: List[str] = ["dhclient"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash startdhcpclient.sh"]
|
||||
validate: List[str] = ["pidof dhclient"]
|
||||
shutdown: List[str] = ["killall dhclient"]
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["startdhcpclient.sh"]
|
||||
executables: list[str] = ["dhclient"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash startdhcpclient.sh"]
|
||||
validate: list[str] = ["pidof dhclient"]
|
||||
shutdown: list[str] = ["killall dhclient"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
ifnames = []
|
||||
for iface in self.node.get_ifaces(control=False):
|
||||
ifnames.append(iface.name)
|
||||
|
@ -183,33 +183,33 @@ class DhcpClientService(ConfigService):
|
|||
class FtpService(ConfigService):
|
||||
name: str = "FTP"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = ["/var/run/vsftpd/empty", "/var/ftp"]
|
||||
files: List[str] = ["vsftpd.conf"]
|
||||
executables: List[str] = ["vsftpd"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["vsftpd ./vsftpd.conf"]
|
||||
validate: List[str] = ["pidof vsftpd"]
|
||||
shutdown: List[str] = ["killall vsftpd"]
|
||||
directories: list[str] = ["/var/run/vsftpd/empty", "/var/ftp"]
|
||||
files: list[str] = ["vsftpd.conf"]
|
||||
executables: list[str] = ["vsftpd"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["vsftpd ./vsftpd.conf"]
|
||||
validate: list[str] = ["pidof vsftpd"]
|
||||
shutdown: list[str] = ["killall vsftpd"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
|
||||
class PcapService(ConfigService):
|
||||
name: str = "pcap"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = []
|
||||
files: List[str] = ["pcap.sh"]
|
||||
executables: List[str] = ["tcpdump"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash pcap.sh start"]
|
||||
validate: List[str] = ["pidof tcpdump"]
|
||||
shutdown: List[str] = ["bash pcap.sh stop"]
|
||||
directories: list[str] = []
|
||||
files: list[str] = ["pcap.sh"]
|
||||
executables: list[str] = ["tcpdump"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash pcap.sh start"]
|
||||
validate: list[str] = ["pidof tcpdump"]
|
||||
shutdown: list[str] = ["bash pcap.sh stop"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
ifnames = []
|
||||
for iface in self.node.get_ifaces(control=False):
|
||||
ifnames.append(iface.name)
|
||||
|
@ -219,20 +219,20 @@ class PcapService(ConfigService):
|
|||
class RadvdService(ConfigService):
|
||||
name: str = "radvd"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = ["/etc/radvd", "/var/run/radvd"]
|
||||
files: List[str] = ["/etc/radvd/radvd.conf"]
|
||||
executables: List[str] = ["radvd"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = [
|
||||
directories: list[str] = ["/etc/radvd", "/var/run/radvd"]
|
||||
files: list[str] = ["/etc/radvd/radvd.conf"]
|
||||
executables: list[str] = ["radvd"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = [
|
||||
"radvd -C /etc/radvd/radvd.conf -m logfile -l /var/log/radvd.log"
|
||||
]
|
||||
validate: List[str] = ["pidof radvd"]
|
||||
shutdown: List[str] = ["pkill radvd"]
|
||||
validate: list[str] = ["pidof radvd"]
|
||||
shutdown: list[str] = ["pkill radvd"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
ifaces = []
|
||||
for iface in self.node.get_ifaces(control=False):
|
||||
prefixes = []
|
||||
|
@ -247,22 +247,22 @@ class RadvdService(ConfigService):
|
|||
class AtdService(ConfigService):
|
||||
name: str = "atd"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = ["/var/spool/cron/atjobs", "/var/spool/cron/atspool"]
|
||||
files: List[str] = ["startatd.sh"]
|
||||
executables: List[str] = ["atd"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["bash startatd.sh"]
|
||||
validate: List[str] = ["pidof atd"]
|
||||
shutdown: List[str] = ["pkill atd"]
|
||||
directories: list[str] = ["/var/spool/cron/atjobs", "/var/spool/cron/atspool"]
|
||||
files: list[str] = ["startatd.sh"]
|
||||
executables: list[str] = ["atd"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["bash startatd.sh"]
|
||||
validate: list[str] = ["pidof atd"]
|
||||
shutdown: list[str] = ["pkill atd"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
|
||||
class HttpService(ConfigService):
|
||||
name: str = "HTTP"
|
||||
group: str = GROUP_NAME
|
||||
directories: List[str] = [
|
||||
directories: list[str] = [
|
||||
"/etc/apache2",
|
||||
"/var/run/apache2",
|
||||
"/var/log/apache2",
|
||||
|
@ -270,21 +270,21 @@ class HttpService(ConfigService):
|
|||
"/var/lock/apache2",
|
||||
"/var/www",
|
||||
]
|
||||
files: List[str] = [
|
||||
files: list[str] = [
|
||||
"/etc/apache2/apache2.conf",
|
||||
"/etc/apache2/envvars",
|
||||
"/var/www/index.html",
|
||||
]
|
||||
executables: List[str] = ["apache2ctl"]
|
||||
dependencies: List[str] = []
|
||||
startup: List[str] = ["chown www-data /var/lock/apache2", "apache2ctl start"]
|
||||
validate: List[str] = ["pidof apache2"]
|
||||
shutdown: List[str] = ["apache2ctl stop"]
|
||||
executables: list[str] = ["apache2ctl"]
|
||||
dependencies: list[str] = []
|
||||
startup: list[str] = ["chown www-data /var/lock/apache2", "apache2ctl start"]
|
||||
validate: list[str] = ["pidof apache2"]
|
||||
shutdown: list[str] = ["apache2ctl stop"]
|
||||
validation_mode: ConfigServiceMode = ConfigServiceMode.BLOCKING
|
||||
default_configs: List[Configuration] = []
|
||||
modes: Dict[str, Dict[str, str]] = {}
|
||||
default_configs: list[Configuration] = []
|
||||
modes: dict[str, dict[str, str]] = {}
|
||||
|
||||
def data(self) -> Dict[str, Any]:
|
||||
def data(self) -> dict[str, Any]:
|
||||
ifaces = []
|
||||
for iface in self.node.get_ifaces(control=False):
|
||||
ifaces.append(iface)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue