summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Nalawade <ganesh634@gmail.com>2018-07-27 20:36:15 +0530
committerMatt Clay <matt@mystile.com>2018-07-27 08:06:15 -0700
commitaee1d42fe72aaabdceaed847cfa8408baa62e48b (patch)
tree9cd5f38a418350e2e925bd2d55c05431a39e109d
parent460183ce47cc31f3176187a25bfa784be066f89b (diff)
downloadansible-aee1d42fe72aaabdceaed847cfa8408baa62e48b.tar.gz
Correcting conditionals looping (#43331) (#43346)
* Correcting conditionals looping (#43331) Empty conditionals would not break out of the loop, causing every command to be run for the same number of times as retries is defined (10 by default) (cherry picked from commit e215f842bab59b15bfbe64dd5409cc1d4a27dbd5) * Update changelog
-rw-r--r--changelogs/fragments/vyos_command_retry.yml2
-rw-r--r--lib/ansible/modules/network/vyos/vyos_command.py6
2 files changed, 5 insertions, 3 deletions
diff --git a/changelogs/fragments/vyos_command_retry.yml b/changelogs/fragments/vyos_command_retry.yml
new file mode 100644
index 0000000000..4e0fd8235a
--- /dev/null
+++ b/changelogs/fragments/vyos_command_retry.yml
@@ -0,0 +1,2 @@
+bugfixes:
+- vyos_command correcting conditionals looping (https://github.com/ansible/ansible/pull/43331).
diff --git a/lib/ansible/modules/network/vyos/vyos_command.py b/lib/ansible/modules/network/vyos/vyos_command.py
index 4f13acff8c..80f8966680 100644
--- a/lib/ansible/modules/network/vyos/vyos_command.py
+++ b/lib/ansible/modules/network/vyos/vyos_command.py
@@ -212,10 +212,10 @@ def main():
break
conditionals.remove(item)
- if not conditionals:
- break
+ if not conditionals:
+ break
- time.sleep(interval)
+ time.sleep(interval)
if conditionals:
failed_conditions = [item.raw for item in conditionals]