Hello Douglas Schilling Landgraf, mooli tayer,
I'd like you to do a code review. Please visit
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 danken@redhat.com Reviewed-on: http://gerrit.ovirt.org/19295 Reviewed-by: mooli tayer mtayer@redhat.com Reviewed-by: Douglas Schilling Landgraf dougsland@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])
Douglas Schilling Landgraf has posted comments on this change.
Change subject: caps: coarse-grain libvirt.rpm may be missing ......................................................................
Patch Set 1: Code-Review+1
mooli tayer has posted comments on this change.
Change subject: caps: coarse-grain libvirt.rpm may be missing ......................................................................
Patch Set 1: Code-Review+1
Yaniv Bronhaim has posted comments on this change.
Change subject: caps: coarse-grain libvirt.rpm may be missing ......................................................................
Patch Set 2: Verified+1 Code-Review+2
Yaniv Bronhaim has submitted this change and it was merged.
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 danken@redhat.com Reviewed-on: http://gerrit.ovirt.org/19295 Reviewed-by: mooli tayer mtayer@redhat.com Reviewed-by: Douglas Schilling Landgraf dougsland@redhat.com Reviewed-on: http://gerrit.ovirt.org/21363 Tested-by: Yaniv Bronhaim ybronhei@redhat.com Reviewed-by: Yaniv Bronhaim ybronhei@redhat.com --- M vdsm/caps.py 1 file changed, 10 insertions(+), 8 deletions(-)
Approvals: Yaniv Bronhaim: Verified; Looks good to me, approved
vdsm-patches@lists.fedorahosted.org