Blob Blame History Raw
From d3c91bc345f27a78d17c836f04fe13f5d1be6856 Mon Sep 17 00:00:00 2001
From: Igor Lvovsky <ilvovsky@redhat.com>
Date: Sun, 10 Jun 2012 10:40:48 +0300
Subject: [PATCH 15/17] BZ#830486 - Allow to change network according the diffs from previous state

We may not receive any information about the bonding device if it is unchanged.
In this case vdsm shouldn't check the bond information of this network.

Change-Id: I1ece66a351576d5789a8968ccda9e67f423b860c
Signed-off-by: Igor Lvovsky <ilvovsky@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/5211
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/5557
Tested-by: Federico Simoncelli <fsimonce@redhat.com>
---
 vdsm/configNetwork.py |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index fce3e71..ab07da6 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -1085,12 +1085,15 @@ def setupNetworks(networks={}, bondings={}, **options):
 
                 d = dict(networkAttrs)
                 if 'bonding' in d:
-                    d['nics'] = bondings[d['bonding']]['nics']
-                    d['bondingOptions'] = bondings[d['bonding']].get('options',
-                                                                     None)
-                    # Don't remove bondX from the bonding list here,
-                    # because it may be in use for other networks
-                    handledBonds.add(d['bonding'])
+                    # we may not receive any information
+                    # about the bonding device if it is unchanged
+                    if bondings:
+                        d['nics'] = bondings[d['bonding']]['nics']
+                        d['bondingOptions'] = bondings[d['bonding']].get('options',
+                                                                         None)
+                        # Don't remove bondX from the bonding list here,
+                        # because it may be in use for other networks
+                        handledBonds.add(d['bonding'])
                 else:
                     d['nics'] = [d.pop('nic')]
                 d['force'] = force
-- 
1.7.1