Exemple #1
0
    def __init__(self):
        Cache.__init__(self)
        Requirements.__init__(self)

        self.sysfs = Sysfs

        self.__batch = {}
        self.__batch_mode = False

        # if bridge utils is not installed overrrides specific functions to
        # avoid constantly checking bridge_utils_is_installed
        if not Requirements.bridge_utils_is_installed:
            self.bridge_set_stp = lambda _, __: None
            self.bridge_del_mcqv4src = lambda _, __: None
            self.bridge_set_mcqv4src = lambda _, __, ___: None
Exemple #2
0
    def __init__(self):
        Netlink.__init__(self)
        Cache.__init__(self)

        self.logger = logging.getLogger("ifupdown2.addons.%s" % self.__class__.__name__)

        self.io = IO()
        self.sysfs = Sysfs
        self.iproute2 = IPRoute2()
        self.requirements = Requirements()

        self.__alias_to_attribute = {}

        for attribute_name, attribute_object in self.__get_modinfo().get("attrs", {}).items():
            for alias in attribute_object.get("aliases", []):
                self.__alias_to_attribute[alias] = attribute_name