Skip to content

Commit

Permalink
Do not fail sanitize_module_args it entries are missing
Browse files Browse the repository at this point in the history
If `sanitize_module_args` is called from `rule_multi` or `rule_purge`
the args do not contain a `api_key` or `api_secret`. This leads to
KeyError exception instead of the nice error message.
  • Loading branch information
jiuka committed Oct 2, 2024
1 parent 55da2f6 commit 0087d7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/module_utils/helper/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,6 @@ def unset_check_error(params: dict, field: str, fail: bool) -> bool:
return True

def sanitize_module_args(args: dict) -> dict:
args.pop('api_key')
args.pop('api_secret')
args.pop('api_key', None)
args.pop('api_secret', None)
return args

0 comments on commit 0087d7f

Please sign in to comment.