summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2013-08-21 12:46:46 +0200
committerMichal Minar <miminar@redhat.com>2013-08-23 06:47:40 +0200
commit1ad3a75d07f2b8d1d0518d76c83c3fb26540bdbe (patch)
tree4e5a1a720f3c7bb4192a9cafff6c98ffd8cd74fa /src
parente67b7d8e30dda7e5dc726fbaf9b69e0af2075c0b (diff)
downloadopenlmi-providers-1ad3a75d07f2b8d1d0518d76c83c3fb26540bdbe.tar.gz
openlmi-providers-1ad3a75d07f2b8d1d0518d76c83c3fb26540bdbe.tar.xz
openlmi-providers-1ad3a75d07f2b8d1d0518d76c83c3fb26540bdbe.zip
software: properly search for packages filtered by repoid
If repoid is given, only 'available' packages need to be searched, otherwise the package is not found if installed. Let's just enable particular repository instead of comparing repoid attribute.
Diffstat (limited to 'src')
-rw-r--r--src/software/lmi/software/yumdb/process.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/software/lmi/software/yumdb/process.py b/src/software/lmi/software/yumdb/process.py
index 1a9e1c0..07bca8f 100644
--- a/src/software/lmi/software/yumdb/process.py
+++ b/src/software/lmi/software/yumdb/process.py
@@ -576,6 +576,15 @@ class YumWorker(Process):
Handler for filtering packages job.
@return [pkg1, pkg2, ...]
"""
+ if kind == 'all' \
+ and filters.get('repoid', None) \
+ and not include_repos and not exclude_repos:
+ # If repoid is given, we are interested only in available
+ # packages, not installed. With kind == 'all' we are not able to
+ # check repoid of installed package (which may be available).
+ kind = 'available'
+ exclude_repos = '*'
+ include_repos = filters.pop('repoid')
pkglist = self._handle_get_package_list(kind, allow_duplicates, False,
include_repos=include_repos, exclude_repos=exclude_repos,
transform=False)