diff --git a/changelogs/fragments/deprecations.yml b/changelogs/fragments/deprecations.yml new file mode 100644 index 0000000000..c8f4f6150a --- /dev/null +++ b/changelogs/fragments/deprecations.yml @@ -0,0 +1,8 @@ +removed_features: + - "redhat_subscriptions - removed the ``pool`` option. Use ``pool_ids`` instead (https://github.com/ansible-collections/community.general/pull/8918)." + - "proxmox_kvm - removed the ``proxmox_default_behavior`` option. Explicitly specify the old default values if you were using ``proxmox_default_behavior=compatibility``, otherwise simply remove it (https://github.com/ansible-collections/community.general/pull/8918)." + - "ejabberd_user - removed the ``logging`` option (https://github.com/ansible-collections/community.general/pull/8918)." + - "consul - removed the ``ack_params_state_absent`` option. It had no effect anymore (https://github.com/ansible-collections/community.general/pull/8918)." +breaking_changes: + - "irc - the defaults of ``use_tls`` and ``validate_certs`` changed from ``false`` to ``true`` (https://github.com/ansible-collections/community.general/pull/8918)." + - "rhsm_repository - the states ``present`` and ``absent`` have been removed. Use ``enabled`` and ``disabled`` instead (https://github.com/ansible-collections/community.general/pull/8918)." diff --git a/plugins/modules/consul.py b/plugins/modules/consul.py index fe1a898835..28beeec52d 100644 --- a/plugins/modules/consul.py +++ b/plugins/modules/consul.py @@ -170,10 +170,6 @@ options: type: str description: - The token key identifying an ACL rule set. May be required to register services. - ack_params_state_absent: - type: bool - description: - - This parameter has no more effect and is deprecated. It will be removed in community.general 10.0.0. ''' EXAMPLES = ''' @@ -598,11 +594,6 @@ def main(): timeout=dict(type='str'), tags=dict(type='list', elements='str'), token=dict(no_log=True), - ack_params_state_absent=dict( - type='bool', - removed_in_version='10.0.0', - removed_from_collection='community.general', - ), ), mutually_exclusive=[ ('script', 'ttl', 'tcp', 'http'), diff --git a/plugins/modules/ejabberd_user.py b/plugins/modules/ejabberd_user.py index d0b575e1cd..b43e078a5d 100644 --- a/plugins/modules/ejabberd_user.py +++ b/plugins/modules/ejabberd_user.py @@ -41,12 +41,6 @@ options: description: - the password to assign to the username required: false - logging: - description: - - enables or disables the local syslog facility for this module - required: false - default: false - type: bool state: type: str description: @@ -75,8 +69,6 @@ EXAMPLES = ''' state: absent ''' -import syslog - from ansible.module_utils.basic import AnsibleModule from ansible_collections.community.general.plugins.module_utils.cmd_runner import CmdRunner, cmd_runner_fmt @@ -91,7 +83,6 @@ class EjabberdUser(object): def __init__(self, module): self.module = module - self.logging = module.params.get('logging') self.state = module.params.get('state') self.host = module.params.get('host') self.user = module.params.get('username') @@ -125,10 +116,8 @@ class EjabberdUser(object): return self.run_command('check_account', 'user host', (lambda rc, out, err: not bool(rc))) def log(self, entry): - """ This method will log information to the local syslog facility """ - if self.logging: - syslog.openlog('ansible-%s' % self.module._name) - syslog.syslog(syslog.LOG_NOTICE, entry) + """ This method does nothing """ + pass def run_command(self, cmd, options, process=None): """ This method will run the any command specified and return the @@ -169,7 +158,6 @@ def main(): username=dict(required=True, type='str'), password=dict(type='str', no_log=True), state=dict(default='present', choices=['present', 'absent']), - logging=dict(default=False, type='bool', removed_in_version='10.0.0', removed_from_collection='community.general'), ), required_if=[ ('state', 'present', ['password']), diff --git a/plugins/modules/irc.py b/plugins/modules/irc.py index e40ba2d0ba..748479e87b 100644 --- a/plugins/modules/irc.py +++ b/plugins/modules/irc.py @@ -85,10 +85,9 @@ options: was exlusively called O(use_ssl). The latter is now an alias of O(use_tls). - B(Note:) for security reasons, you should always set O(use_tls=true) and O(validate_certs=true) whenever possible. - - The option currently defaults to V(false). The default has been B(deprecated) and will - change to V(true) in community.general 10.0.0. To avoid deprecation warnings, explicitly - set this option to a value (preferably V(true)). + - The default of this option changed to V(true) in community.general 10.0.0. type: bool + default: true aliases: - use_ssl part: @@ -110,10 +109,9 @@ options: if the network between between Ansible and the IRC server is known to be safe. - B(Note:) for security reasons, you should always set O(use_tls=true) and O(validate_certs=true) whenever possible. - - The option currently defaults to V(false). The default has been B(deprecated) and will - change to V(true) in community.general 10.0.0. To avoid deprecation warnings, explicitly - set this option to a value (preferably V(true)). + - The default of this option changed to V(true) in community.general 10.0.0. type: bool + default: true version_added: 8.1.0 # informational: requirements for nodes @@ -313,8 +311,8 @@ def main(): passwd=dict(no_log=True), timeout=dict(type='int', default=30), part=dict(type='bool', default=True), - use_tls=dict(type='bool', aliases=['use_ssl']), - validate_certs=dict(type='bool'), + use_tls=dict(type='bool', default=True, aliases=['use_ssl']), + validate_certs=dict(type='bool', default=True), ), supports_check_mode=True, required_one_of=[['channel', 'nick_to']] @@ -338,25 +336,6 @@ def main(): style = module.params["style"] validate_certs = module.params["validate_certs"] - if use_tls is None: - module.deprecate( - 'The default of use_tls will change to true in community.general 10.0.0.' - ' Set a value now (preferably true, if possible) to avoid the deprecation warning.', - version='10.0.0', - collection_name='community.general', - ) - use_tls = False - - if validate_certs is None: - if use_tls: - module.deprecate( - 'The default of validate_certs will change to true in community.general 10.0.0.' - ' Set a value now (prefarably true, if possible) to avoid the deprecation warning.', - version='10.0.0', - collection_name='community.general', - ) - validate_certs = False - try: send_msg(msg, server, port, channel, nick_to, key, topic, nick, color, passwd, timeout, use_tls, validate_certs, part, style) except Exception as e: diff --git a/plugins/modules/proxmox_kvm.py b/plugins/modules/proxmox_kvm.py index 771ddd902f..cac3496228 100644 --- a/plugins/modules/proxmox_kvm.py +++ b/plugins/modules/proxmox_kvm.py @@ -14,7 +14,7 @@ module: proxmox_kvm short_description: Management of Qemu(KVM) Virtual Machines in Proxmox VE cluster description: - Allows you to create/delete/stop Qemu(KVM) Virtual Machines in Proxmox VE cluster. - - Since community.general 4.0.0 on, there are no more default values, see O(proxmox_default_behavior). + - Since community.general 4.0.0 on, there are no more default values. author: "Abdoul Bah (@helldorado) " attributes: check_mode: @@ -32,7 +32,6 @@ options: acpi: description: - Specify if ACPI should be enabled/disabled. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(true). type: bool agent: description: @@ -44,19 +43,15 @@ options: description: - Pass arbitrary arguments to kvm. - This option is for experts only! - - If O(proxmox_default_behavior) is set to V(compatibility), this option has a default of - V(-serial unix:/var/run/qemu-server/.serial,server,nowait). type: str autostart: description: - Specify if the VM should be automatically restarted after crash (currently ignored in PVE API). - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(false). type: bool balloon: description: - Specify the amount of RAM for the VM in MB. - Using zero disables the balloon driver. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(0). type: int bios: description: @@ -68,7 +63,6 @@ options: - Specify the boot order -> boot on floppy V(a), hard disk V(c), CD-ROM V(d), or network V(n). - For newer versions of Proxmox VE, use a boot order like V(order=scsi0;net0;hostpci0). - You can combine to set order. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(cnd). type: str bootdisk: description: @@ -104,12 +98,10 @@ options: cores: description: - Specify number of cores per socket. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(1). type: int cpu: description: - Specify emulated CPU type. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(kvm64). type: str cpulimit: description: @@ -120,7 +112,6 @@ options: description: - Specify CPU weight for a VM. - You can disable fair-scheduler configuration by setting this to 0 - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(1000). type: int delete: description: @@ -173,7 +164,6 @@ options: description: - Allow to force stop VM. - Can be used with states V(stopped), V(restarted), and V(absent). - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(false). - Requires parameter O(archive). type: bool format: @@ -184,8 +174,7 @@ options: - Please refer to the Proxmox VE Administrator Guide, section Proxmox VE Storage (see U(https://pve.proxmox.com/pve-docs/chapter-pvesm.html) for the latest version, tables 3 to 14) to find out format supported by the provided storage backend. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(qcow2). - If O(proxmox_default_behavior) is set to V(no_defaults), not specifying this option is equivalent to setting it to V(unspecified). + - Not specifying this option is equivalent to setting it to V(unspecified). type: str choices: [ "cloop", "cow", "qcow", "qcow2", "qed", "raw", "vmdk", "unspecified" ] freeze: @@ -257,7 +246,6 @@ options: kvm: description: - Enable/disable KVM hardware virtualization. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(true). type: bool localtime: description: @@ -277,7 +265,6 @@ options: memory: description: - Memory size in MB for instance. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(512). type: int migrate: description: @@ -340,13 +327,11 @@ options: onboot: description: - Specifies whether a VM will be started during system bootup. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(true). type: bool ostype: description: - Specifies guest operating system. This is used to enable special optimization/features for specific operating systems. - The l26 is Linux 2.6/3.X Kernel. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(l26). type: str choices: ['other', 'wxp', 'w2k', 'w2k3', 'w2k8', 'wvista', 'win7', 'win8', 'win10', 'win11', 'l24', 'l26', 'solaris'] parallel: @@ -439,7 +424,6 @@ options: sockets: description: - Sets the number of CPU sockets. (1 - N). - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(1). type: int sshkeys: description: @@ -472,7 +456,6 @@ options: tablet: description: - Enables/disables the USB tablet device. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(false). type: bool tags: description: @@ -494,7 +477,6 @@ options: template: description: - Enables/disables the template. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(false). type: bool timeout: description: @@ -553,7 +535,6 @@ options: vga: description: - Select VGA type. If you want to use high resolution modes (>= 1280x1024x16) then you should use option 'std' or 'vmware'. - - This option has no default unless O(proxmox_default_behavior) is set to V(compatibility); then the default is V(std). type: str choices: ['std', 'cirrus', 'vmware', 'qxl', 'serial0', 'serial1', 'serial2', 'serial3', 'qxl2', 'qxl3', 'qxl4'] virtio: @@ -571,24 +552,6 @@ options: description: - Creates a virtual hardware watchdog device. type: str - proxmox_default_behavior: - description: - - As of community.general 4.0.0, various options no longer have default values. - These default values caused problems when users expected different behavior from Proxmox - by default or filled options which caused problems when set. - - The value V(compatibility) (default before community.general 4.0.0) will ensure that the default values - are used when the values are not explicitly specified by the user. The new default is V(no_defaults), - which makes sure these options have no defaults. - - This affects the O(acpi), O(autostart), O(balloon), O(boot), O(cores), O(cpu), - O(cpuunits), O(force), O(format), O(kvm), O(memory), O(onboot), O(ostype), O(sockets), - O(tablet), O(template), and O(vga) options. - - This option is deprecated and will be removed in community.general 10.0.0. - type: str - default: no_defaults - choices: - - compatibility - - no_defaults - version_added: "1.3.0" seealso: - module: community.general.proxmox_vm_info extends_documentation_fragment: @@ -1143,10 +1106,7 @@ class ProxmoxKvmAnsible(ProxmoxAnsible): kwargs['tags'] = ",".join(kwargs['tags']) # -args and skiplock require root@pam user - but can not use api tokens - if self.module.params['api_user'] == "root@pam" and self.module.params['args'] is None: - if not update and self.module.params['proxmox_default_behavior'] == 'compatibility': - kwargs['args'] = vm_args - elif self.module.params['api_user'] == "root@pam" and self.module.params['args'] is not None: + if self.module.params['api_user'] == "root@pam" and self.module.params['args'] is not None: kwargs['args'] = self.module.params['args'] elif self.module.params['api_user'] != "root@pam" and self.module.params['args'] is not None: self.module.fail_json(msg='args parameter require root@pam user. ') @@ -1330,11 +1290,6 @@ def main(): virtio=dict(type='dict'), vmid=dict(type='int'), watchdog=dict(), - proxmox_default_behavior=dict(type='str', - default='no_defaults', - choices=['compatibility', 'no_defaults'], - removed_from_collection='community.general', - removed_in_version='10.0.0'), ) module_args.update(kvm_args) @@ -1363,28 +1318,6 @@ def main(): vmid = module.params['vmid'] validate_certs = module.params['validate_certs'] - if module.params['proxmox_default_behavior'] == 'compatibility': - old_default_values = dict( - acpi=True, - autostart=False, - balloon=0, - boot='cnd', - cores=1, - cpu='kvm64', - cpuunits=1000, - format='qcow2', - kvm=True, - memory=512, - ostype='l26', - sockets=1, - tablet=False, - template=False, - vga='std', - ) - for param, value in old_default_values.items(): - if module.params[param] is None: - module.params[param] = value - if module.params['format'] == 'unspecified': module.params['format'] = None diff --git a/plugins/modules/redhat_subscription.py b/plugins/modules/redhat_subscription.py index 4a7aac483e..338fb92ebd 100644 --- a/plugins/modules/redhat_subscription.py +++ b/plugins/modules/redhat_subscription.py @@ -39,7 +39,7 @@ notes: - Since community.general 6.5.0, credentials (that is, O(username) and O(password), O(activationkey), or O(token)) are needed only in case the the system is not registered, or O(force_register) is specified; this makes it possible to use the module to tweak an - already registered system, for example attaching pools to it (using O(pool), or O(pool_ids)), + already registered system, for example attaching pools to it (using O(pool_ids)), and modifying the C(syspurpose) attributes (using O(syspurpose)). requirements: - subscription-manager @@ -138,29 +138,14 @@ options: description: - Register with a specific environment in the destination org. Used with Red Hat Satellite or Katello type: str - pool: - description: - - | - Specify a subscription pool name to consume. Regular expressions accepted. - Mutually exclusive with O(pool_ids). - - | - Please use O(pool_ids) instead: specifying pool IDs is much faster, - and it avoids to match new pools that become available for the - system and are not explicitly wanted. Also, this option does not - support quantities. - - | - This option is deprecated for the reasons mentioned above, - and it will be removed in community.general 10.0.0. - default: '^$' - type: str pool_ids: description: - | - Specify subscription pool IDs to consume. Prefer over O(pool) when possible as it is much faster. + Specify subscription pool IDs to consume. A pool ID may be specified as a C(string) - just the pool ID (for example V(0123456789abcdef0123456789abcdef)), or as a C(dict) with the pool ID as the key, and a quantity as the value (for example V(0123456789abcdef0123456789abcdef: 2). If the quantity is provided, it is used to consume multiple - entitlements from a pool (the pool must support this). Mutually exclusive with O(pool). + entitlements from a pool (the pool must support this). default: [] type: list elements: raw @@ -261,20 +246,6 @@ EXAMPLES = ''' password: somepass consumer_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -- name: Register with activationkey and consume subscriptions matching Red Hat Enterprise Server or Red Hat Virtualization - community.general.redhat_subscription: - state: present - activationkey: 1-222333444 - org_id: 222333444 - pool: '^(Red Hat Enterprise Server|Red Hat Virtualization)$' - -- name: Update the consumed subscriptions from the previous example (remove Red Hat Virtualization subscription) - community.general.redhat_subscription: - state: present - activationkey: 1-222333444 - org_id: 222333444 - pool: '^Red Hat Enterprise Server$' - - name: Register as user credentials into given environment (against Red Hat Satellite or Katello), and auto-subscribe. community.general.redhat_subscription: state: present @@ -783,42 +754,6 @@ class Rhsm(object): self.update_plugin_conf('rhnplugin', False) self.update_plugin_conf('subscription-manager', False) - def subscribe(self, regexp): - ''' - Subscribe current system to available pools matching the specified - regular expression. It matches regexp against available pool ids first. - If any pool ids match, subscribe to those pools and return. - - If no pool ids match, then match regexp against available pool product - names. Note this can still easily match many many pools. Then subscribe - to those pools. - - Since a pool id is a more specific match, we only fallback to matching - against names if we didn't match pool ids. - - Raises: - * Exception - if error occurs while running command - ''' - # See https://github.com/ansible/ansible/issues/19466 - - # subscribe to pools whose pool id matches regexp (and only the pool id) - subscribed_pool_ids = self.subscribe_pool(regexp) - - # If we found any matches, we are done - # Don't attempt to match pools by product name - if subscribed_pool_ids: - return subscribed_pool_ids - - # We didn't match any pool ids. - # Now try subscribing to pools based on product name match - # Note: This can match lots of product names. - subscribed_by_product_pool_ids = self.subscribe_product(regexp) - if subscribed_by_product_pool_ids: - return subscribed_by_product_pool_ids - - # no matches - return [] - def subscribe_by_pool_ids(self, pool_ids): """ Try to subscribe to the list of pool IDs @@ -837,56 +772,6 @@ class Rhsm(object): self.module.fail_json(msg='Pool ID: %s not in list of available pools' % pool_id) return pool_ids - def subscribe_pool(self, regexp): - ''' - Subscribe current system to available pools matching the specified - regular expression - Raises: - * Exception - if error occurs while running command - ''' - - # Available pools ready for subscription - available_pools = RhsmPools(self.module) - - subscribed_pool_ids = [] - for pool in available_pools.filter_pools(regexp): - pool.subscribe() - subscribed_pool_ids.append(pool.get_pool_id()) - return subscribed_pool_ids - - def subscribe_product(self, regexp): - ''' - Subscribe current system to available pools matching the specified - regular expression - Raises: - * Exception - if error occurs while running command - ''' - - # Available pools ready for subscription - available_pools = RhsmPools(self.module) - - subscribed_pool_ids = [] - for pool in available_pools.filter_products(regexp): - pool.subscribe() - subscribed_pool_ids.append(pool.get_pool_id()) - return subscribed_pool_ids - - def update_subscriptions(self, regexp): - changed = False - consumed_pools = RhsmPools(self.module, consumed=True) - pool_ids_to_keep = [p.get_pool_id() for p in consumed_pools.filter_pools(regexp)] - pool_ids_to_keep.extend([p.get_pool_id() for p in consumed_pools.filter_products(regexp)]) - - serials_to_remove = [p.Serial for p in consumed_pools if p.get_pool_id() not in pool_ids_to_keep] - serials = self.unsubscribe(serials=serials_to_remove) - - subscribed_pool_ids = self.subscribe(regexp) - - if subscribed_pool_ids or serials: - changed = True - return {'changed': changed, 'subscribed_pool_ids': subscribed_pool_ids, - 'unsubscribed_serials': serials} - def update_subscriptions_by_pool_ids(self, pool_ids): changed = False consumed_pools = RhsmPools(self.module, consumed=True) @@ -1109,11 +994,6 @@ def main(): 'activationkey': {'no_log': True}, 'org_id': {}, 'environment': {}, - 'pool': { - 'default': '^$', - 'removed_in_version': '10.0.0', - 'removed_from_collection': 'community.general', - }, 'pool_ids': {'default': [], 'type': 'list', 'elements': 'raw'}, 'consumer_type': {}, 'consumer_name': {}, @@ -1144,8 +1024,7 @@ def main(): ['token', 'username'], ['activationkey', 'consumer_id'], ['activationkey', 'environment'], - ['activationkey', 'auto_attach'], - ['pool', 'pool_ids']], + ['activationkey', 'auto_attach']], required_if=[['force_register', True, ['username', 'activationkey', 'token'], True]], ) @@ -1173,7 +1052,6 @@ def main(): if activationkey and not org_id: module.fail_json(msg='org_id is required when using activationkey') environment = module.params['environment'] - pool = module.params['pool'] pool_ids = {} for value in module.params['pool_ids']: if isinstance(value, dict): @@ -1217,12 +1095,9 @@ def main(): rhsm.sync_syspurpose() except Exception as e: module.fail_json(msg="Failed to synchronize syspurpose attributes: %s" % to_native(e)) - if pool != '^$' or pool_ids: + if pool_ids: try: - if pool_ids: - result = rhsm.update_subscriptions_by_pool_ids(pool_ids) - else: - result = rhsm.update_subscriptions(pool) + result = rhsm.update_subscriptions_by_pool_ids(pool_ids) except Exception as e: module.fail_json(msg="Failed to update subscriptions for '%s': %s" % (server_hostname, to_native(e))) else: @@ -1245,8 +1120,6 @@ def main(): rhsm.sync_syspurpose() if pool_ids: subscribed_pool_ids = rhsm.subscribe_by_pool_ids(pool_ids) - elif pool != '^$': - subscribed_pool_ids = rhsm.subscribe(pool) else: subscribed_pool_ids = [] except Exception as e: diff --git a/plugins/modules/rhsm_repository.py b/plugins/modules/rhsm_repository.py index e58389102e..ed8b0e7d58 100644 --- a/plugins/modules/rhsm_repository.py +++ b/plugins/modules/rhsm_repository.py @@ -36,11 +36,9 @@ options: description: - If state is equal to present or disabled, indicates the desired repository state. - - | - Please note that V(present) and V(absent) are deprecated, and will be - removed in community.general 10.0.0; please use V(enabled) and - V(disabled) instead. - choices: [present, enabled, absent, disabled] + - In community.general 10.0.0 the states V(present) and V(absent) have been + removed. Please use V(enabled) and V(disabled) instead. + choices: [enabled, disabled] default: "enabled" type: str name: @@ -240,7 +238,7 @@ def main(): module = AnsibleModule( argument_spec=dict( name=dict(type='list', elements='str', required=True), - state=dict(choices=['enabled', 'disabled', 'present', 'absent'], default='enabled'), + state=dict(choices=['enabled', 'disabled'], default='enabled'), purge=dict(type='bool', default=False), ), supports_check_mode=True, @@ -257,14 +255,6 @@ def main(): state = module.params['state'] purge = module.params['purge'] - if state in ['present', 'absent']: - replacement = 'enabled' if state == 'present' else 'disabled' - module.deprecate( - 'state=%s is deprecated; please use state=%s instead' % (state, replacement), - version='10.0.0', - collection_name='community.general', - ) - repository_modify(module, rhsm, state, name, purge) diff --git a/tests/integration/targets/proxmox/tasks/main.yml b/tests/integration/targets/proxmox/tasks/main.yml index 1b529d1112..1ce9767b70 100644 --- a/tests/integration/targets/proxmox/tasks/main.yml +++ b/tests/integration/targets/proxmox/tasks/main.yml @@ -585,7 +585,6 @@ api_token_id: "{{ api_token_id | default(omit) }}" api_token_secret: "{{ api_token_secret | default(omit) }}" validate_certs: "{{ validate_certs }}" - proxmox_default_behavior: "no_defaults" node: "{{ node }}" vmid: "{{ vmid }}" state: absent diff --git a/tests/unit/plugins/modules/test_redhat_subscription.py b/tests/unit/plugins/modules/test_redhat_subscription.py index 9473d0d46f..7be3740d26 100644 --- a/tests/unit/plugins/modules/test_redhat_subscription.py +++ b/tests/unit/plugins/modules/test_redhat_subscription.py @@ -432,73 +432,6 @@ TEST_CASES = [ 'msg': "System successfully registered to 'None'." } ], - # Test of registration using username and password and attach to pool - [ - { - 'state': 'present', - 'username': 'admin', - 'password': 'admin', - 'org_id': 'admin', - 'pool': 'ff8080816b8e967f016b8e99632804a6' - }, - { - 'id': 'test_registeration_username_password_pool', - 'run_command.calls': [ - ( - ['/testbin/subscription-manager', 'identity'], - {'check_rc': False}, - (1, 'This system is not yet registered.', '') - ), - ( - [ - '/testbin/subscription-manager', - 'register', - '--org', 'admin', - '--username', 'admin', - '--password', 'admin' - ], - {'check_rc': True, 'expand_user_and_vars': False}, - (0, '', '') - ), - ( - [ - 'subscription-manager list --available', - {'check_rc': True, 'environ_update': {'LANG': 'C', 'LC_ALL': 'C', 'LC_MESSAGES': 'C'}}, - (0, - ''' -+-------------------------------------------+ - Available Subscriptions -+-------------------------------------------+ -Subscription Name: SP Server Premium (S: Premium, U: Production, R: SP Server) -Provides: SP Server Bits -SKU: sp-server-prem-prod -Contract: 0 -Pool ID: ff8080816b8e967f016b8e99632804a6 -Provides Management: Yes -Available: 5 -Suggested: 1 -Service Type: L1-L3 -Roles: SP Server -Service Level: Premium -Usage: Production -Add-ons: -Subscription Type: Standard -Starts: 06/25/19 -Ends: 06/24/20 -Entitlement Type: Physical -''', ''), - ] - ), - ( - 'subscription-manager attach --pool ff8080816b8e967f016b8e99632804a6', - {'check_rc': True}, - (0, '', '') - ) - ], - 'changed': True, - 'msg': "System successfully registered to 'None'." - } - ], # Test of registration using username and password and attach to pool ID and quantities [ { diff --git a/tests/unit/plugins/modules/test_rhsm_repository.py b/tests/unit/plugins/modules/test_rhsm_repository.py index e822c7e844..b73b43b4c5 100644 --- a/tests/unit/plugins/modules/test_rhsm_repository.py +++ b/tests/unit/plugins/modules/test_rhsm_repository.py @@ -648,39 +648,6 @@ TEST_CASES = [ 'repositories': REPOS.copy().disable('awesomeos-99000'), } ], - # disable an enabled repository (using state=absent) - [ - { - 'name': 'awesomeos-99000', - 'state': 'absent', - }, - { - 'id': 'test_disable_single_using_absent', - 'run_command.calls': [ - ( - [ - '/testbin/subscription-manager', - 'repos', - '--list', - ], - SUBMAN_KWARGS, - (0, REPOS_LIST_OUTPUT, '') - ), - ( - [ - '/testbin/subscription-manager', - 'repos', - '--disable', - 'awesomeos-99000', - ], - SUBMAN_KWARGS, - (0, '', '') - ), - ], - 'changed': True, - 'repositories': REPOS.copy().disable('awesomeos-99000'), - } - ], # disable an already disabled repository [ {