From 855f74248674e57915843b00d2250ae77f0aa6fc Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Sat, 24 Sep 2022 07:15:36 +0200 Subject: [PATCH] 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 --- library/ceph_key.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/ceph_key.py b/library/ceph_key.py index a0ca3b2a0..a444b2d88 100644 --- a/library/ceph_key.py +++ b/library/ceph_key.py @@ -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( -- 2.47.3