Пример #1
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)
Пример #2
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)
Пример #3
0
 def addBond(self, bond):
     if bond.name not in bonding.bondings():
         logging.debug('Add new bonding %s', bond)
         with open(bonding.BONDING_MASTERS, 'w') as f:
             f.write('+%s' % bond.name)