From 8e8a7c869ae219debf80456d3edac5804af22c2c Mon Sep 17 00:00:00 2001 From: Bobby Watson Date: Fri, 18 Aug 2017 11:06:46 -0400 Subject: [PATCH] Changed string check to verify that EOS device is not in config mode. (#28332) Changed string check to verify that EOS device is not in config mode. This was required in order to work with Arista 7500 series modular switches. Resolves #2830 --- lib/ansible/plugins/action/eos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/eos.py b/lib/ansible/plugins/action/eos.py index 6e453980ad7..15517058ccf 100644 --- a/lib/ansible/plugins/action/eos.py +++ b/lib/ansible/plugins/action/eos.py @@ -76,7 +76,7 @@ class ActionModule(_ActionModule): # make sure we are in the right cli context which should be # enable mode and not config module rc, out, err = connection.exec_command('prompt()') - while str(out).strip().endswith(')#'): + while '(config' in str(out): display.vvvv('wrong context, sending exit to device', self._play_context.remote_addr) connection.exec_command('exit') rc, out, err = connection.exec_command('prompt()')