mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
The 'unsubscribe' command of 'subscription-manager' was deprecated
already in subscription-manager 1.11.3, shipped with RHEL 5.11.
As it was removed in subscription-manager 1.29.x, unsubscribing from
pools was thus broken.
The simple fix is to call the proper command, 'remove'.
(cherry picked from commit a45b90e93f
)
Co-authored-by: Pino Toscano <ptoscano@redhat.com>
This commit is contained in:
parent
9835deb17f
commit
40b35acee2
3 changed files with 6 additions and 3 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- redhat_subscription - fix unsubscribing on RHEL 9 (https://github.com/ansible-collections/community.general/issues/4741).
|
|
@ -468,7 +468,7 @@ class Rhsm(RegistrationBase):
|
|||
items = ["--all"]
|
||||
|
||||
if items:
|
||||
args = [SUBMAN_CMD, 'unsubscribe'] + items
|
||||
args = [SUBMAN_CMD, 'remove'] + items
|
||||
rc, stderr, stdout = self.module.run_command(args, check_rc=True)
|
||||
return serials
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Author: Jiri Hnidek (jhnidek@redhat.com)
|
||||
#
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
@ -118,7 +119,7 @@ TEST_CASES = [
|
|||
(0, 'system identity: b26df632-25ed-4452-8f89-0308bfd167cb', '')
|
||||
),
|
||||
(
|
||||
['/testbin/subscription-manager', 'unsubscribe', '--all'],
|
||||
['/testbin/subscription-manager', 'remove', '--all'],
|
||||
{'check_rc': True},
|
||||
(0, '', '')
|
||||
),
|
||||
|
@ -755,7 +756,7 @@ Entitlement Type: Physical
|
|||
(
|
||||
[
|
||||
'/testbin/subscription-manager',
|
||||
'unsubscribe',
|
||||
'remove',
|
||||
'--serial=7807912223970164816',
|
||||
],
|
||||
{'check_rc': True},
|
||||
|
|
Loading…
Reference in a new issue