Petr Horáček has uploaded a new change for review.
Change subject: pyroute2: reuse created devices
......................................................................
pyroute2: reuse created devices
When we try to create new device over existing one, pyroute2 raises
exception, while other configurators doesn't.
Now, if we try to create device which already exists, pyroute2 just
return existing device with no complains.
Change-Id: Ief8c2ad9e9a1a7369e4e81495daa3e31e613b5e5
Signed-off-by: Petr Horáček <phoracek(a)redhat.com>
---
M vdsm/network/configurators/pyroute_two.py
1 file changed, 4 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/97/34197/1
diff --git a/vdsm/network/configurators/pyroute_two.py
b/vdsm/network/configurators/pyroute_two.py
index 59050e3..4986c12 100644
--- a/vdsm/network/configurators/pyroute_two.py
+++ b/vdsm/network/configurators/pyroute_two.py
@@ -108,7 +108,7 @@
self.ifup(iface)
def addBridge(self, bridge):
- self.ip.create(kind='bridge', ifname=bridge.name).commit()
+ self.ip.create(kind='bridge', ifname=bridge.name, reuse=True).commit()
def addBridgePort(self, bridge):
with self.ip.interfaces[bridge.name] as i:
@@ -124,8 +124,8 @@
def addVlan(self, vlan):
link = self.ip.interfaces[vlan.device.name].index
- self.ip.create(kind='vlan', ifname=vlan.name,
- link=link, vlan_id=vlan.tag).commit()
+ self.ip.create(kind='vlan', ifname=vlan.name, link=link,
+ vlan_id=vlan.tag, reuse=True).commit()
def removeVlan(self, vlan):
with self.ip.interfaces[vlan.name] as i:
@@ -133,7 +133,7 @@
def addBond(self, bond):
if bond.name not in netinfo.bondings():
- self.ip.create(kind='bond', ifname=bond.name).commit()
+ self.ip.create(kind='bond', ifname=bond.name, reuse=True).commit()
def removeBond(self, bond):
with self.ip.interfaces[bond.name] as i:
--
To view, visit
http://gerrit.ovirt.org/34197
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief8c2ad9e9a1a7369e4e81495daa3e31e613b5e5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>