Пример #1
0
    def configure(self, **opts):
        # in a limited condition, we should not touch the nic config
        if (self.vlan and nics.operstate(self.name) == nics.OPERSTATE_UP
                and ifaceUsed(self.name)
                and self.mtu <= mtus.getMtu(self.name)):
            return

        self.configurator.configureNic(self, **opts)
Пример #2
0
    def configure(self, **opts):
        # in a limited condition, we should not touch the nic config
        if (self.vlan and
                nics.operstate(self.name) == nics.OPERSTATE_UP and
                ifaceUsed(self.name) and
                self.mtu <= mtus.getMtu(self.name)):
            return

        self.configurator.configureNic(self, **opts)
Пример #3
0
    def configure(self, **opts):
        # When the bond is up and we are not changing the configuration that
        # is already applied in any way, we can skip the configuring.
        if (self.vlan and self.name in bonding.bondings()
                and (not self.configurator.unifiedPersistence
                     or self.name in self.configurator.runningConfig.bonds)
                and nics.operstate(self.name) == nics.OPERSTATE_UP
                and ifaceUsed(self.name) and self.mtu <= mtus.getMtu(self.name)
                and self.areOptionsApplied()
                and frozenset(slave.name
                              for slave in self.slaves) == frozenset(
                                  bonding.slaves(self.name))):
            return

        self.configurator.configureBond(self, **opts)
Пример #4
0
    def configure(self, **opts):
        # When the bond is up and we are not changing the configuration that
        # is already applied in any way, we can skip the configuring.
        if (self.vlan and
            self.name in bonding.bondings() and
            (not self.configurator.unifiedPersistence or
             self.name in self.configurator.runningConfig.bonds) and
            nics.operstate(self.name) == nics.OPERSTATE_UP and
            ifaceUsed(self.name) and
            self.mtu <= mtus.getMtu(self.name) and
            self.areOptionsApplied() and
            frozenset(slave.name for slave in self.slaves) ==
                frozenset(bonding.slaves(self.name))):
                return

        self.configurator.configureBond(self, **opts)