Hello Douglas Schilling Landgraf, mooli tayer,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/21363

to review the following change.

Change subject: caps: coarse-grain libvirt.rpm may be missing
......................................................................

caps: coarse-grain libvirt.rpm may be missing

As of http://gerrit.ovirt.org/15761 we no longer require the legacy
libvirt.rpm to be installed on Fedora, so getCaps should not look for
it. Instead, it should report the information of the installed
libvirt-daemon-kvm.rpm.

Without this patch we get an annoying
    (_getKeyPackages) rpm package libvirt not found
log message, and do not report libvirt's version.

Change-Id: I733a1a2411c910caa030e435c2a7f751a8e4dad4
Signed-off-by: Dan Kenigsberg <dan...@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/19295
Reviewed-by: mooli tayer <mta...@redhat.com>
Reviewed-by: Douglas Schilling Landgraf <dougsl...@redhat.com>
---
M vdsm/caps.py
1 file changed, 10 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/21363/1

diff --git a/vdsm/caps.py b/vdsm/caps.py
index 3a7a6a2..c5ecadc 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -20,6 +20,7 @@
 
 """Collect host capabilities"""
 
+import itertools
 import os
 from xml.dom import minidom
 import logging
@@ -323,12 +324,12 @@
     pkgs = {'kernel': kernelDict()}
 
     if getos() in (OSName.RHEVH, OSName.OVIRT, OSName.FEDORA, OSName.RHEL):
-        KEY_PACKAGES = {'qemu-kvm': 'qemu-kvm',
-                        'qemu-img': 'qemu-img',
-                        'vdsm': 'vdsm',
-                        'spice-server': 'spice-server',
-                        'libvirt': 'libvirt',
-                        'mom': 'mom',
+        KEY_PACKAGES = {'qemu-kvm': ('qemu-kvm',),
+                        'qemu-img': ('qemu-img',),
+                        'vdsm': ('vdsm',),
+                        'spice-server': ('spice-server',),
+                        'libvirt': ('libvirt', 'libvirt-daemon-kvm'),
+                        'mom': ('mom',),
                         }
 
         if _glusterEnabled:
@@ -337,9 +338,10 @@
         try:
             ts = rpm.TransactionSet()
 
-            for pkg in KEY_PACKAGES:
+            for pkg, names in KEY_PACKAGES.iteritems():
                 try:
-                    mi = ts.dbMatch('name', KEY_PACKAGES[pkg]).next()
+                    mi = itertools.chain(*[ts.dbMatch('name', name)
+                                           for name in names]).next()
                 except StopIteration:
                     logging.debug("rpm package %s not found",
                                   KEY_PACKAGES[pkg])


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I733a1a2411c910caa030e435c2a7f751a8e4dad4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsl...@redhat.com>
Gerrit-Reviewer: mooli tayer <mta...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to