From 14fca45cb793f60aa0cc5b33eb63e12e440a09f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sat, 17 Sep 2022 12:06:21 +0200 Subject: [PATCH] Refactoring - run_once() renamed to run_iteration() --- inventory_plugins/reconstructed.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inventory_plugins/reconstructed.py b/inventory_plugins/reconstructed.py index 08ce4ab..5cd2656 100644 --- a/inventory_plugins/reconstructed.py +++ b/inventory_plugins/reconstructed.py @@ -384,8 +384,8 @@ class RcInstruction(abc.ABC): This method is the entry point for instruction execution. Depending on whether an iteration clause is present or not, it will either call - ``run_once()`` directly or evaluate the loop data then run it once for - each item, after setting the loop variable. + :py:meth:`run_iteration` directly or evaluate the loop data then run it + once for each item, after setting the loop variable. Args: host_name: the name of the host to execute the instruction for @@ -397,7 +397,7 @@ class RcInstruction(abc.ABC): """ if self._loop is None: self._display.vvvv("%s : running action %s" % (host_name, self._action)) - return self.run_once(host_name, variables) + return self.run_iteration(host_name, variables) # Save previous loop variable state variables._script_stack_push([self._loop_var]) try: @@ -408,14 +408,14 @@ class RcInstruction(abc.ABC): % (host_name, self._action, repr(value)) ) variables[self._loop_var] = value - if not self.run_once(host_name, variables): + if not self.run_iteration(host_name, variables): return False return True finally: # Restore loop variable state variables._script_stack_pop() - def run_once(self, host_name, variables): + def run_iteration(self, host_name, variables): """Check the condition if it exists, then run the instruction. Args: