mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 08:35:21 +00:00
get dnf distro in more portable way
This commit is contained in:
parent
94f7ef29a5
commit
6211e5b414
@ -16,7 +16,6 @@ from tests.support.helpers import (
|
||||
|
||||
# Import Salt libs
|
||||
from salt.ext import six
|
||||
from salt.modules.yumpkg import _yum
|
||||
import salt.utils.pkg
|
||||
import salt.utils.platform
|
||||
|
||||
@ -176,6 +175,7 @@ class PkgModuleTest(ModuleCase, SaltReturnAssertsMixin):
|
||||
'''
|
||||
test holding and unholding a package
|
||||
'''
|
||||
|
||||
def hold_package():
|
||||
self.run_function('pkg.install', [self.pkg])
|
||||
|
||||
@ -189,7 +189,9 @@ class PkgModuleTest(ModuleCase, SaltReturnAssertsMixin):
|
||||
self.run_function('pkg.remove', [self.pkg])
|
||||
|
||||
if grains['os_family'] == 'RedHat':
|
||||
lock_pkg = 'yum-plugin-versionlock' if _yum() == 'yum' else \
|
||||
lock_pkg = 'yum-plugin-versionlock'
|
||||
# get correct plugin for dnf packages following the logic in `salt.modules.yumpkg._yum`
|
||||
if 'fedora' in grains['os'].lower() and int(grains['osrelease']) >= 22:
|
||||
'python{py}-dnf-plugin-versionlock'.format(py=3 if six.PY3 else 2)
|
||||
|
||||
version_lock = None
|
||||
|
Loading…
Reference in New Issue
Block a user