library: fix a bug in ceph_key module

`name` is a mandatory parameter when `state` is either
`present` or `absent` or `update` or `info`.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/7431/head
Guillaume Abrioux 2022-09-24 07:15:36 +02:00 committed by Teoman ONAY
parent 86ab93efbb
commit 855f742486
1 changed files with 4 additions and 0 deletions

View File

@ -519,6 +519,10 @@ def run_module():
user_key = module.params.get('user_key')
output_format = module.params.get('output_format')
# Can't use required_if with 'name' for some reason...
if state in ['present', 'absent', 'update', 'info'] and not name:
fatal(f'"state" is "{state}" but "name" is not defined.', module)
changed = False
result = dict(