From eeb26d83430c59047e7f3e78aed949b9a6e8921d Mon Sep 17 00:00:00 2001 From: mtlaird Date: Thu, 9 Aug 2018 11:47:52 -0700 Subject: [PATCH 1/2] Fix case where args or kwargs are not specified Currently, the m_ret line will error if the loop state definition does not specify values for args or kwargs, because None is neither iterable nor a map. If not specified, those values should be set to an empty list and empty dict. (cherry picked from commit f0c0bd08b82e97401b39bb59395d880bda14676a) --- salt/states/loop.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/salt/states/loop.py b/salt/states/loop.py index edaf8c306371..efd475ecd173 100644 --- a/salt/states/loop.py +++ b/salt/states/loop.py @@ -94,7 +94,11 @@ def until(name, ret['comment'] = 'The execution module {0} will be run'.format(name) ret['result'] = None return ret - + if not m_args: + m_args = [] + if not m_kwargs: + m_kwargs = {} + def timed_out(): if time.time() >= timeout: return True From 03e651907952652402bf5416c6d046d625695aab Mon Sep 17 00:00:00 2001 From: Mike Place Date: Fri, 10 Aug 2018 21:32:56 +0200 Subject: [PATCH 2/2] Remove trailing whitespace (cherry picked from commit 8cb7937f616270d5ea32d519904a0cd0ffba66c9) --- salt/states/loop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/states/loop.py b/salt/states/loop.py index efd475ecd173..db4971ceb0fe 100644 --- a/salt/states/loop.py +++ b/salt/states/loop.py @@ -98,7 +98,7 @@ def until(name, m_args = [] if not m_kwargs: m_kwargs = {} - + def timed_out(): if time.time() >= timeout: return True