mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
[PR #6673/2dbe529a backport][stable-7] rhsm_repository: deprecate "state=present" and "state=absent" (#6675)
rhsm_repository: deprecate "state=present" and "state=absent" (#6673)
"state=present" is broken, and acts like "disabled"; also, the
subscription repositories cannot be really "added" or "removed", which
is what "present" and "absent" would imply, but only enabled or
disabled. Hence, deprecate both these states, slating them for removal
in community.general 10.0.0.
(cherry picked from commit 2dbe529a90
)
Co-authored-by: Pino Toscano <ptoscano@redhat.com>
This commit is contained in:
parent
f986b97c9a
commit
7b0890c98f
2 changed files with 20 additions and 0 deletions
|
@ -36,6 +36,10 @@ 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]
|
||||
default: "enabled"
|
||||
type: str
|
||||
|
@ -253,6 +257,14 @@ 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, state, name, purge)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue