[node-patches] Change in ovirt-node[master]: network: add Bonds.delete()

fabiand at fedoraproject.org fabiand at fedoraproject.org
Thu Aug 8 12:11:25 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: network: add Bonds.delete()
......................................................................

network: add Bonds.delete()

Method to remove a single bond device.

Change-Id: Ia2eada10beeb981ecf6b4dbe1b51d2c38f8daea7
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/utils/network.py
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/32/17832/1

diff --git a/src/ovirt/node/utils/network.py b/src/ovirt/node/utils/network.py
index af78d05..edbe870 100644
--- a/src/ovirt/node/utils/network.py
+++ b/src/ovirt/node/utils/network.py
@@ -829,3 +829,9 @@
         """Deletes all bond devices
         """
         process.call("rmmod bonding 2> /dev/null", shell=True)
+
+    def delete(self, ifname):
+        if not self.is_bond(ifname):
+            raise RuntimeError("Can no delete '%s', is no bond" % ifname)
+        process.call(["ip", "link", "set", "dev", ifname, "down"])
+        process.call(["ip", "link", "delete", ifname, "type", "bond"])


-- 
To view, visit http://gerrit.ovirt.org/17832
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2eada10beeb981ecf6b4dbe1b51d2c38f8daea7
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list