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 link_vlan.is_base_device(nic.name): if nic.bridge is not None: dhclient.stop(nic.name, 4) dhclient.stop(nic.name, 6) ipwrapper.linkSet(nic.name, ['down']) else: ifdown(nic.name) _ifup(nic)
def _drop_dhcp_config(iface): dhclient.stop(iface, 4) dhclient.stop(iface, 6)
def ifdown(self, iface): ipwrapper.linkSet(iface.name, ['down']) dhclient.stop(iface.name)
def dhclient_run(iface, family=4): dhclient.run(iface, family, blocking_dhcp=True) try: yield finally: dhclient.stop(iface, family)
def ifdown(self, iface): with self.ip.interfaces[iface.name] as i: i.down() dhclient.stop(iface.name)
def dhclient_run(iface): dhclient.run(iface, blocking_dhcp=True) try: yield finally: dhclient.stop(iface)