From 2e472930fafd8e377410b500a0339585ab9f1c4e Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Tue, 15 Aug 2017 23:51:55 -0500 Subject: add dnf support to roles/openshift_health_checker/library/aos_version.py Signed-off-by: Adam Miller --- roles/lib_openshift/src/lib/base.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'roles/lib_openshift/src') diff --git a/roles/lib_openshift/src/lib/base.py b/roles/lib_openshift/src/lib/base.py index 16770b22d..5a307cdb3 100644 --- a/roles/lib_openshift/src/lib/base.py +++ b/roles/lib_openshift/src/lib/base.py @@ -464,13 +464,12 @@ class Utils(object): @staticmethod def openshift_installed(): ''' check if openshift is installed ''' - import yum + import rpm - yum_base = yum.YumBase() - if yum_base.rpmdb.searchNevra(name='atomic-openshift'): - return True + transaction_set = rpm.TransactionSet() + rpmquery = transaction_set.dbMatch("name", "atomic-openshift") - return False + return rpmquery.count() > 0 # Disabling too-many-branches. This is a yaml dictionary comparison function # pylint: disable=too-many-branches,too-many-return-statements,too-many-statements -- cgit v1.2.3