Change in vdsm[master]: vm: Do not assume drive's iface attribute exists

ykaplan at redhat.com ykaplan at redhat.com
Tue Dec 3 09:12:20 UTC 2013


Yeela Kaplan has uploaded a new change for review.

Change subject: vm: Do not assume drive's iface attribute exists
......................................................................

vm: Do not assume drive's iface attribute exists

Change-Id: I672688989fda521864e191063681e5c1d1f24992
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1011472
Signed-off-by: Yeela Kaplan <ykaplan at redhat.com>
---
M vdsm/vm.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/39/21939/1

diff --git a/vdsm/vm.py b/vdsm/vm.py
index e8d5954..a55d3cd 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -2052,7 +2052,7 @@
         return confDrives
 
     def updateDriveIndex(self, drv):
-        if not drv['iface'] in self._usedIndices:
+        if drv.get('iface') and drv['iface'] not in self._usedIndices:
             self._usedIndices[drv['iface']] = []
         drv['index'] = self.__getNextIndex(self._usedIndices[drv['iface']])
         self._usedIndices[drv['iface']].append(int(drv['index']))
@@ -2061,7 +2061,7 @@
         drives = [(order, drv) for order, drv in enumerate(confDrives)]
         indexed = []
         for order, drv in drives:
-            if drv['iface'] not in self._usedIndices:
+            if drv.get('iface') and drv['iface'] not in self._usedIndices:
                 self._usedIndices[drv['iface']] = []
             idx = drv.get('index')
             if idx is not None:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I672688989fda521864e191063681e5c1d1f24992
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan at redhat.com>


More information about the vdsm-patches mailing list