Esempio n. 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)
Esempio n. 2
0
 def configureBond(self, bond, **opts):
     self.configApplier.addBond(bond)
     if not bond.areOptionsApplied():
         self.configApplier.ifdown(bond)
         self.configApplier.addBondOptions(bond)
     for slave in bond.slaves:
         if slave.name not in bonding.slaves(bond.name):
             self.configApplier.addBondSlave(bond, slave)
             slave.configure(**opts)
     DynamicSourceRoute.addInterfaceTracking(bond)
     self.configApplier.setIfaceConfigAndUp(bond)
     self._addSourceRoute(bond)
     self.runningConfig.setBonding(
         bond.name, {'options': bond.options,
                     'nics': [slave.name for slave in bond.slaves]})
Esempio n. 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)
Esempio n. 4
0
File: ifcfg.py Progetto: mykaul/vdsm
 def setBondingMtu(self, bonding, newmtu):
     self.setIfaceMtu(bonding, newmtu)
     slaves = netinfo_bonding.slaves(bonding)
     for slave in slaves:
         self.setIfaceMtu(slave, newmtu)
Esempio n. 5
0
 def setBondingMtu(self, bonding, newmtu):
     self.setIfaceMtu(bonding, newmtu)
     slaves = netinfo_bonding.slaves(bonding)
     for slave in slaves:
         self.setIfaceMtu(slave, newmtu)