Beispiel #1
0
 def configureNic(self, nic, **opts):
     self.configApplier.addNic(nic, **opts)
     self._addSourceRoute(nic)
     if nic.bond is None:
         if not vlans.is_vlanned(nic.name):
             ifdown(nic.name)
         _ifup(nic)
Beispiel #2
0
    def configureBond(self, bond, **opts):
        if not self.owned_device(bond.name):
            IfcfgAcquire.acquire_device(bond.name)
        self.configApplier.addBonding(bond, self.net_info, **opts)
        if not vlans.is_vlanned(bond.name):
            for slave in bond.slaves:
                ifdown(slave.name)
        for slave in bond.slaves:
            slave.configure(**opts)
        self._addSourceRoute(bond)
        _ifup(bond)

        # When acquiring the device from NM, it may take a few seconds until
        # the bond is released by NM and loaded through initscripts.
        # Giving it a chance to come up before continuing.
        with waitfor.waitfor_linkup(bond.name):
            pass

        bond_attr = {
            'options': bond.options,
            'nics': sorted(s.name for s in bond.slaves),
            'switch': 'legacy'
        }
        if bond.hwaddr:
            bond_attr['hwaddr'] = bond.hwaddr
        self.runningConfig.setBonding(bond.name, bond_attr)
Beispiel #3
0
 def configureNic(self, nic, **opts):
     self.configApplier.addNic(nic, **opts)
     self._addSourceRoute(nic)
     if nic.bond is None:
         if not vlans.is_vlanned(nic.name):
             ifdown(nic.name)
         _ifup(nic)
Beispiel #4
0
 def configureNic(self, nic, **opts):
     if not self.owned_device(nic.name):
         IfcfgAcquire.acquire_device(nic.name)
     self.configApplier.addNic(nic, **opts)
     self._addSourceRoute(nic)
     if nic.bond is None:
         if not vlans.is_vlanned(nic.name):
             ifdown(nic.name)
         _ifup(nic)
Beispiel #5
0
 def configureNic(self, nic, **opts):
     if not self.owned_device(nic.name):
         IfcfgAcquire.acquire_device(nic.name)
     self.configApplier.addNic(nic, self.net_info, **opts)
     self._addSourceRoute(nic)
     if nic.bond is None:
         if not vlans.is_vlanned(nic.name):
             ifdown(nic.name)
         _ifup(nic)
Beispiel #6
0
 def configureNic(self, nic, **opts):
     if not self.owned_device(nic.name):
         self.normalize_device_filename(nic.name)
     self.configApplier.addNic(nic, **opts)
     self._addSourceRoute(nic)
     if nic.bond is None:
         if not vlans.is_vlanned(nic.name):
             ifdown(nic.name)
         _ifup(nic)
Beispiel #7
0
 def configureBond(self, bond, **opts):
     self.configApplier.addBonding(bond, **opts)
     if not vlans.is_vlanned(bond.name):
         for slave in bond.slaves:
             ifdown(slave.name)
     for slave in bond.slaves:
         slave.configure(**opts)
     self._addSourceRoute(bond)
     _ifup(bond)
     if self.unifiedPersistence:
         self.runningConfig.setBonding(
             bond.name, {'options': bond.options,
                         'nics': [slave.name for slave in bond.slaves],
                         'switch': 'legacy'})
Beispiel #8
0
 def configureBond(self, bond, **opts):
     if not self.owned_device(bond.name):
         IfcfgAcquire.acquire_device(bond.name)
     self.configApplier.addBonding(bond, **opts)
     if not vlans.is_vlanned(bond.name):
         for slave in bond.slaves:
             ifdown(slave.name)
     for slave in bond.slaves:
         slave.configure(**opts)
     self._addSourceRoute(bond)
     _ifup(bond)
     if self.unifiedPersistence:
         self.runningConfig.setBonding(
             bond.name, {"options": bond.options, "nics": [slave.name for slave in bond.slaves], "switch": "legacy"}
         )
Beispiel #9
0
 def configureBond(self, bond, **opts):
     self.configApplier.addBonding(bond, **opts)
     if not vlans.is_vlanned(bond.name):
         for slave in bond.slaves:
             ifdown(slave.name)
     for slave in bond.slaves:
         slave.configure(**opts)
     self._addSourceRoute(bond)
     _ifup(bond)
     if self.unifiedPersistence:
         self.runningConfig.setBonding(
             bond.name, {
                 'options': bond.options,
                 'nics': [slave.name for slave in bond.slaves],
                 'switch': 'legacy'
             })
Beispiel #10
0
    def configureBond(self, bond, **opts):
        if not self.owned_device(bond.name):
            IfcfgAcquire.acquire_device(bond.name)
        self.configApplier.addBonding(bond, self.net_info, **opts)
        if not vlans.is_vlanned(bond.name):
            for slave in bond.slaves:
                ifdown(slave.name)
        for slave in bond.slaves:
            slave.configure(**opts)
        self._addSourceRoute(bond)
        _ifup(bond)

        # When acquiring the device from NM, it may take a few seconds until
        # the bond is released by NM and loaded through initscripts.
        # Giving it a chance to come up before continuing.
        with waitfor.waitfor_linkup(bond.name):
            pass

        self.runningConfig.setBonding(
            bond.name, {'options': bond.options,
                        'nics': sorted(s.name for s in bond.slaves),
                        'switch': 'legacy'})