Skip to content

Commit

Permalink
Merge pull request #5101 from maxamillion/add-dnf-support
Browse files Browse the repository at this point in the history
Add dnf support
  • Loading branch information
sdodson authored Aug 23, 2017
2 parents 2a4f954 + 1daba5e commit 1c104f2
Show file tree
Hide file tree
Showing 30 changed files with 165 additions and 162 deletions.
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_adm_ca_server_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,13 +1288,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_adm_manage_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,13 +1274,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_adm_policy_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,13 +1260,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_adm_policy_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,13 +1260,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_adm_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1378,13 +1378,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_adm_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -1403,13 +1403,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_clusterrole.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,13 +1252,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_configmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1258,13 +1258,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1302,13 +1302,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -1269,13 +1269,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1242,13 +1242,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,13 +1261,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -1278,13 +1278,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -1281,13 +1281,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_objectvalidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1213,13 +1213,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1270,13 +1270,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1267,13 +1267,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_pvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,13 +1274,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -1312,13 +1312,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,13 +1256,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_secret.py
Original file line number Diff line number Diff line change
Expand Up @@ -1308,13 +1308,12 @@ def add_custom_versions(versions):
@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
Expand Down
9 changes: 4 additions & 5 deletions roles/lib_openshift/library/oc_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1315,13 +1315,12 @@ def add_custom_versions(versions):
@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
Expand Down
Loading

0 comments on commit 1c104f2

Please sign in to comment.