From 0e60b869ae748f4733d5901a33a619d6cf40b377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Mon, 20 Sep 2021 13:11:05 -0400 Subject: [PATCH] common/_wait_for: ensure label_selectors is optional The label_selectors is a new parameter for _wait_for that was introduced in https://github.com/ansible-collections/kubernetes.core/pull/158. The value is new and it can be set to None to make it optional. It should not be mandatory a non optional parameter. --- changelogs/fragments/_wait_for_label_selector_optional.yaml | 3 +++ plugins/module_utils/common.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/_wait_for_label_selector_optional.yaml diff --git a/changelogs/fragments/_wait_for_label_selector_optional.yaml b/changelogs/fragments/_wait_for_label_selector_optional.yaml new file mode 100644 index 00000000000..da18fbef71c --- /dev/null +++ b/changelogs/fragments/_wait_for_label_selector_optional.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: +- ``Ensure the label_selectors parameter of _wait_for method is optional.`` diff --git a/plugins/module_utils/common.py b/plugins/module_utils/common.py index 1326a4fb88c..37884589666 100644 --- a/plugins/module_utils/common.py +++ b/plugins/module_utils/common.py @@ -365,7 +365,7 @@ def diff_objects(self, existing, new): def fail(self, msg=None): self.fail_json(msg=msg) - def _wait_for(self, resource, name, namespace, predicate, sleep, timeout, state, label_selectors): + def _wait_for(self, resource, name, namespace, predicate, sleep, timeout, state, label_selectors=None): start = datetime.now() def _wait_for_elapsed():