Blame 0015-BZ-830486-Allow-to-change-network-according-the-diff.patch

83b9f8f
From d3c91bc345f27a78d17c836f04fe13f5d1be6856 Mon Sep 17 00:00:00 2001
83b9f8f
From: Igor Lvovsky <ilvovsky@redhat.com>
83b9f8f
Date: Sun, 10 Jun 2012 10:40:48 +0300
83b9f8f
Subject: [PATCH 15/17] BZ#830486 - Allow to change network according the diffs from previous state
83b9f8f
83b9f8f
We may not receive any information about the bonding device if it is unchanged.
83b9f8f
In this case vdsm shouldn't check the bond information of this network.
83b9f8f
83b9f8f
Change-Id: I1ece66a351576d5789a8968ccda9e67f423b860c
83b9f8f
Signed-off-by: Igor Lvovsky <ilvovsky@redhat.com>
83b9f8f
Reviewed-on: http://gerrit.ovirt.org/5211
83b9f8f
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
83b9f8f
Reviewed-on: http://gerrit.ovirt.org/5557
83b9f8f
Tested-by: Federico Simoncelli <fsimonce@redhat.com>
83b9f8f
---
83b9f8f
 vdsm/configNetwork.py |   15 +++++++++------
83b9f8f
 1 files changed, 9 insertions(+), 6 deletions(-)
83b9f8f
83b9f8f
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
83b9f8f
index fce3e71..ab07da6 100755
83b9f8f
--- a/vdsm/configNetwork.py
83b9f8f
+++ b/vdsm/configNetwork.py
83b9f8f
@@ -1085,12 +1085,15 @@ def setupNetworks(networks={}, bondings={}, **options):
83b9f8f
 
83b9f8f
                 d = dict(networkAttrs)
83b9f8f
                 if 'bonding' in d:
83b9f8f
-                    d['nics'] = bondings[d['bonding']]['nics']
83b9f8f
-                    d['bondingOptions'] = bondings[d['bonding']].get('options',
83b9f8f
-                                                                     None)
83b9f8f
-                    # Don't remove bondX from the bonding list here,
83b9f8f
-                    # because it may be in use for other networks
83b9f8f
-                    handledBonds.add(d['bonding'])
83b9f8f
+                    # we may not receive any information
83b9f8f
+                    # about the bonding device if it is unchanged
83b9f8f
+                    if bondings:
83b9f8f
+                        d['nics'] = bondings[d['bonding']]['nics']
83b9f8f
+                        d['bondingOptions'] = bondings[d['bonding']].get('options',
83b9f8f
+                                                                         None)
83b9f8f
+                        # Don't remove bondX from the bonding list here,
83b9f8f
+                        # because it may be in use for other networks
83b9f8f
+                        handledBonds.add(d['bonding'])
83b9f8f
                 else:
83b9f8f
                     d['nics'] = [d.pop('nic')]
83b9f8f
                 d['force'] = force
83b9f8f
-- 
83b9f8f
1.7.1
83b9f8f