mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #24768 from jfindlay/pkg_mod
fix yum versionlock on RHEL/CentOS 5, disable corresponding test
This commit is contained in:
commit
0f9298263b
@ -1303,9 +1303,12 @@ def hold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W0613
|
||||
salt '*' pkg.hold <package name>
|
||||
salt '*' pkg.hold pkgs='["foo", "bar"]'
|
||||
'''
|
||||
if 'yum-plugin-versionlock' not in list_pkgs():
|
||||
|
||||
on_redhat_5 = __grains__.get('osmajorrelease', None) == '5'
|
||||
lock_pkg = 'yum-versionlock' if on_redhat_5 else 'yum-plugin-versionlock'
|
||||
if lock_pkg not in list_pkgs():
|
||||
raise SaltInvocationError(
|
||||
'Packages cannot be held, yum-plugin-versionlock is not installed.'
|
||||
'Packages cannot be held, {0} is not installed.'.format(lock_pkg)
|
||||
)
|
||||
if not name and not pkgs and not sources:
|
||||
raise SaltInvocationError(
|
||||
@ -1396,9 +1399,12 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06
|
||||
salt '*' pkg.unhold <package name>
|
||||
salt '*' pkg.unhold pkgs='["foo", "bar"]'
|
||||
'''
|
||||
if 'yum-plugin-versionlock' not in list_pkgs():
|
||||
|
||||
on_redhat_5 = __grains__.get('osmajorrelease', None) == '5'
|
||||
lock_pkg = 'yum-versionlock' if on_redhat_5 else 'yum-plugin-versionlock'
|
||||
if lock_pkg not in list_pkgs():
|
||||
raise SaltInvocationError(
|
||||
'Packages cannot be unheld, yum-plugin-versionlock is not installed.'
|
||||
'Packages cannot be unheld, {0} is not installed.'.format(lock_pkg)
|
||||
)
|
||||
if not name and not pkgs and not sources:
|
||||
raise SaltInvocationError(
|
||||
|
@ -1,5 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
# Import Salt Testing libs
|
||||
from salttesting.helpers import (
|
||||
destructiveTest,
|
||||
@ -121,6 +123,10 @@ class PkgModuleTest(integration.ModuleCase,
|
||||
os_major_release = self.run_function('grains.item', ['osmajorrelease'])['osmajorrelease']
|
||||
available = self.run_function('sys.doc', ['pkg.hold'])
|
||||
|
||||
if os_family == 'RedHat':
|
||||
if os_major_release == '5':
|
||||
self.skipTest('`yum versionlock` does not seem to work on RHEL/CentOS 5')
|
||||
|
||||
if available:
|
||||
if os_family == 'RedHat':
|
||||
lock_pkg = 'yum-versionlock' if os_major_release == '5' else 'yum-plugin-versionlock'
|
||||
|
Loading…
Reference in New Issue
Block a user