[node-patches] Change in ovirt-node[master]: network: Fix Bonding.delete_all()
fabiand at fedoraproject.org
fabiand at fedoraproject.org
Thu Aug 29 09:39:22 UTC 2013
Fabian Deutsch has uploaded a new change for review.
Change subject: network: Fix Bonding.delete_all()
......................................................................
network: Fix Bonding.delete_all()
Previously the class tried to read a file which is only available when
the bonding module is loaded. This could lead to an exception when there
was a "greedy" call to Bonding.delete_all() (so not checking if bonding
was enabled at all).
This is onw fixed by only reading the file when bonding is enabled.
Change-Id: Iba592a6e02fd036283fec899e9081edabc941e2b
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/utils/network.py
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/84/18684/1
diff --git a/src/ovirt/node/utils/network.py b/src/ovirt/node/utils/network.py
index 7bcc922..f0a046d 100644
--- a/src/ovirt/node/utils/network.py
+++ b/src/ovirt/node/utils/network.py
@@ -821,7 +821,10 @@
def ifnames(self):
"""Return the ifnames of all bond devices
"""
- return fs.File(self.bonding_masters_filename).read().split()
+ ifnames = []
+ if self.is_enabled():
+ ifnames = fs.File(self.bonding_masters_filename).read().split()
+ return ifnames
def is_bond(self, ifname):
"""Determins if ifname is a bond device
--
To view, visit http://gerrit.ovirt.org/18684
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba592a6e02fd036283fec899e9081edabc941e2b
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