rename rhsm_repository_release to rhsm_release (#53430)

no changelog needed, as it is a new module for 2.8
This commit is contained in:
James Cassell 2019-03-21 11:21:45 -04:00 committed by Adam Miller
parent 2d172ee8ca
commit 530771e6f8
2 changed files with 15 additions and 15 deletions

View file

@ -14,21 +14,21 @@ ANSIBLE_METADATA = {
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: rhsm_repository_release module: rhsm_release
short_description: Set or Unset RHSM Repository Release version short_description: Set or Unset RHSM Release version
version_added: '2.8' version_added: '2.8'
description: description:
- Sets or unsets the release version used by RHSM repositories. - Sets or unsets the release version used by RHSM repositories.
notes: notes:
- This module will fail on an unregistered system. - This module will fail on an unregistered system.
Use the C(redhat_subscription) module to register a system Use the C(redhat_subscription) module to register a system
prior to setting the RHSM repository release. prior to setting the RHSM release.
requirements: requirements:
- Red Hat Enterprise Linux 6+ with subscription-manager installed - Red Hat Enterprise Linux 6+ with subscription-manager installed
options: options:
release: release:
description: description:
- RHSM repository release version to use (use null to unset) - RHSM release version to use (use null to unset)
required: true required: true
author: author:
- Sean Myers (@seandst) - Sean Myers (@seandst)
@ -36,24 +36,24 @@ author:
EXAMPLES = ''' EXAMPLES = '''
# Set release version to 7.1 # Set release version to 7.1
- name: Set RHSM repository release version - name: Set RHSM release version
rhsm_repository_release: rhsm_release:
release: "7.1" release: "7.1"
# Set release version to 6Server # Set release version to 6Server
- name: Set RHSM repository release version - name: Set RHSM release version
rhsm_repository_release: rhsm_release:
release: "6Server" release: "6Server"
# Unset release version # Unset release version
- name: Unset RHSM repository release release - name: Unset RHSM release release
rhsm_repository_release: rhsm_release:
release: null release: null
''' '''
RETURN = ''' RETURN = '''
current_release: current_release:
description: The current RHSM repository release version value description: The current RHSM release version value
returned: success returned: success
type: str type: str
''' '''

View file

@ -5,13 +5,13 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
from units.compat.mock import call, patch from units.compat.mock import call, patch
from ansible.modules.packaging.os import rhsm_repository_release from ansible.modules.packaging.os import rhsm_release
from units.modules.utils import ( from units.modules.utils import (
AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args) AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args)
class RhsmRepositoryReleaseModuleTestCase(ModuleTestCase): class RhsmRepositoryReleaseModuleTestCase(ModuleTestCase):
module = rhsm_repository_release module = rhsm_release
def setUp(self): def setUp(self):
super(RhsmRepositoryReleaseModuleTestCase, self).setUp() super(RhsmRepositoryReleaseModuleTestCase, self).setUp()
@ -19,12 +19,12 @@ class RhsmRepositoryReleaseModuleTestCase(ModuleTestCase):
# Mainly interested that the subscription-manager calls are right # Mainly interested that the subscription-manager calls are right
# based on the module args, so patch out run_command in the module. # based on the module args, so patch out run_command in the module.
# returns (rc, out, err) structure # returns (rc, out, err) structure
self.mock_run_command = patch('ansible.modules.packaging.os.rhsm_repository_release.' self.mock_run_command = patch('ansible.modules.packaging.os.rhsm_release.'
'AnsibleModule.run_command') 'AnsibleModule.run_command')
self.module_main_command = self.mock_run_command.start() self.module_main_command = self.mock_run_command.start()
# Module does a get_bin_path check before every run_command call # Module does a get_bin_path check before every run_command call
self.mock_get_bin_path = patch('ansible.modules.packaging.os.rhsm_repository_release.' self.mock_get_bin_path = patch('ansible.modules.packaging.os.rhsm_release.'
'AnsibleModule.get_bin_path') 'AnsibleModule.get_bin_path')
self.get_bin_path = self.mock_get_bin_path.start() self.get_bin_path = self.mock_get_bin_path.start()
self.get_bin_path.return_value = '/testbin/subscription-manager' self.get_bin_path.return_value = '/testbin/subscription-manager'