Skip to content

Commit

Permalink
Check that auth value is not None (#151)
Browse files Browse the repository at this point in the history
* Check that auth value is not None

The previous check for truth prevented the verify_ssl param from being
set to false, thus forcing ssl verfication in every case.

* Add changelog fragment

* Fix linting
  • Loading branch information
gravesm authored Jun 24, 2021
1 parent 35af8a4 commit 15799b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelogs/fragments/151-check-auth-params-for-existence.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- check auth params for existence, not whether they are true (https://github.com/ansible-collections/kubernetes.core/pull/151).
2 changes: 1 addition & 1 deletion plugins/module_utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _raise_or_fail(exc, msg):

# If authorization variables aren't defined, look for them in environment variables
for true_name, arg_name in AUTH_ARG_MAP.items():
if module and module.params.get(arg_name):
if module and module.params.get(arg_name) is not None:
auth[true_name] = module.params.get(arg_name)
elif arg_name in kwargs and kwargs.get(arg_name) is not None:
auth[true_name] = kwargs.get(arg_name)
Expand Down

0 comments on commit 15799b2

Please sign in to comment.