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
This commit is contained in:
Bobby Watson 2017-08-18 11:06:46 -04:00 committed by Chris Alfonso
parent bd56e6c9ce
commit 8e8a7c869a

View file

@ -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()')