From 938f7e12e8601654a2477862c40586a21abab2b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Wed, 22 Sep 2021 18:37:06 -0400 Subject: [PATCH] common/_wait_for: ensure label_selectors is optional (#239) common/_wait_for: ensure label_selectors is optional Depends-On: ansible/ansible-zuul-jobs#1125 The label_selectors is a new parameter for _wait_for that was introduced in #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. Reviewed-by: None Reviewed-by: Alina Buzachis Reviewed-by: None --- 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 0000000000..fffd12835e --- /dev/null +++ b/changelogs/fragments/_wait_for_label_selector_optional.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: +- common - 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 1326a4fb88..3788458966 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():