summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrishna Guha <trishnaguha17@gmail.com>2019-04-17 03:32:07 +0530
committerToshio Kuratomi <a.badger@gmail.com>2019-04-16 15:02:07 -0700
commitca49ae7ba5af69b515af9417a2c156decc424166 (patch)
treec2b06c1a57ef212e4ad1a82e508bc9dd019acd6e
parent1435b6771ae4ad60c261bbe52da96fce9fbd8616 (diff)
downloadansible-ca49ae7ba5af69b515af9417a2c156decc424166.tar.gz
nxos_interface DI delay only when operation state check is requested (#55355)
* nxos_interface:DI: delay only when operation state check is requested (#54862) * nxos_interface:DI: should only use delay when operation state check is requested There is a 10 second delay that is added for every interface that is changed. This delay should only occur when a task sets one of the `want` vars. * /return/continue/ (cherry picked from commit 0fe6bf911af78cffda9b17831ab2cb394ce2c0e9) * changelog Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
-rw-r--r--changelogs/fragments/nxos_interfaces_27_fix.yaml2
-rw-r--r--lib/ansible/modules/network/nxos/nxos_interface.py7
2 files changed, 6 insertions, 3 deletions
diff --git a/changelogs/fragments/nxos_interfaces_27_fix.yaml b/changelogs/fragments/nxos_interfaces_27_fix.yaml
new file mode 100644
index 0000000000..1e58ed6b4f
--- /dev/null
+++ b/changelogs/fragments/nxos_interfaces_27_fix.yaml
@@ -0,0 +1,2 @@
+bugfixes:
+- nxos_interface DI delay only when operation state check is requested (https://github.com/ansible/ansible/pull/54862).
diff --git a/lib/ansible/modules/network/nxos/nxos_interface.py b/lib/ansible/modules/network/nxos/nxos_interface.py
index b706ca8f2b..0cfa6e665c 100644
--- a/lib/ansible/modules/network/nxos/nxos_interface.py
+++ b/lib/ansible/modules/network/nxos/nxos_interface.py
@@ -590,15 +590,16 @@ def check_declarative_intent_params(module, want):
failed_conditions = []
have_neighbors = None
for w in want:
+ if w['interface_type']:
+ continue
want_tx_rate = w.get('tx_rate')
want_rx_rate = w.get('rx_rate')
want_neighbors = w.get('neighbors')
+ if not (want_tx_rate or want_rx_rate or want_neighbors):
+ continue
time.sleep(module.params['delay'])
- if w['interface_type']:
- return
-
cmd = [{'command': 'show interface {0}'.format(w['name']), 'output': 'text'}]
try: