Change in vdsm[master]: caps: wolkaround for libvirt's canonical name in machine types

mpolednik at redhat.com mpolednik at redhat.com
Tue Jun 9 11:38:22 UTC 2015


Martin Polednik has uploaded a new change for review.

Change subject: caps: wolkaround for libvirt's canonical name in machine types
......................................................................

caps: wolkaround for libvirt's canonical name in machine types

Libvirt ussualy returns the machine type as 'text' attribute of the
XML, but few versions return it in the 'canonical' attribute. This
patch is walkaround for that.

Change-Id: Ic0bade940d7d548be18eb779cde324e37231ce73
Bug-Url: https://bugzilla.redhat.com/1229396
Signed-off-by: Martin Polednik <mpolednik at redhat.com>
---
M vdsm/caps.py
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/42082/1

diff --git a/vdsm/caps.py b/vdsm/caps.py
index 3304ad1..493b921 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -389,7 +389,12 @@
 
     for archTag in caps.iter(tag='arch'):
         if archTag.get('name') == arch:
-            return [m.text for m in archTag.iterfind('machine')]
+            return list(itertools.chain.from_iterable(
+                (
+                    (m.text, m.get('canonical')) if
+                    m.get('canonical') else (m.text,)
+                )
+                for m in archTag.iterfind('machine')))
 
     return []
 


-- 
To view, visit https://gerrit.ovirt.org/42082
To unsubscribe, visit https://gerrit.ovirt.org/settings

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


More information about the vdsm-patches mailing list