Change in vdsm[master]: vdsm: prepareVolumePath correct path handling for cdrom

mpoledni at redhat.com mpoledni at redhat.com
Thu Oct 10 10:29:03 UTC 2013


Martin Polednik has uploaded a new change for review.

Change subject: vdsm: prepareVolumePath correct path handling for cdrom
......................................................................

vdsm: prepareVolumePath correct path handling for cdrom

prepareVolumePath checked looked 'path' key in specParams
without looking at path in device itself, causing empty
path in specParams to override path in device. This patch
adds device.path to checking mechanism to avoid overriding
valid path

https://bugzilla.redhat.com/show_bug.cgi?id=1009469

Change-Id: I10e5e0c12e7cc37a692c0e5c47eed3e4c8e7cda9
Signed-off-by: Martin Polednik <mpoledni at redhat.com>
---
M vdsm/clientIF.py
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/20074/1

diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 47851b1..537ef2c 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -303,11 +303,11 @@
                 volPath = self._getUUIDSpecPath(drive["UUID"])
 
             # leave path == '' for empty cdrom and floppy drives ...
-            elif drive['device'] in ('cdrom', 'floppy') and \
-                    'specParams' in drive and \
-                    'path' in drive['specParams'] and \
-                    drive['specParams']['path'] == '':
-                        volPath = ''
+            elif (drive['device'] in ('cdrom', 'floppy') and
+                  hasattr(drive, 'specParams') and
+                  drive.specParams.get('path', '') == '' and
+                  drive.get('path', '') == ''):
+                    volPath = ''
 
             # ... or load the drive from vmPayload:
             elif drive['device'] in ('cdrom', 'floppy') and \


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I10e5e0c12e7cc37a692c0e5c47eed3e4c8e7cda9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpoledni at redhat.com>


More information about the vdsm-patches mailing list