diff --git a/lib/ansible/modules/network/eos/eos_l2_interface.py b/lib/ansible/modules/network/eos/eos_l2_interface.py index 4ebb64f4d7..a8fe9cecc4 100644 --- a/lib/ansible/modules/network/eos/eos_l2_interface.py +++ b/lib/ansible/modules/network/eos/eos_l2_interface.py @@ -207,8 +207,9 @@ def map_config_to_obj(module): instances = list() for item in set(match): - command = 'sh int {0} switchport | include Switchport' - switchport_cfg = run_commands(module, command.format(item))[0].split(':')[1].strip() + command = {'command': 'show interfaces {0} switchport | include Switchport'.format(item), + 'output': 'text'} + switchport_cfg = run_commands(module, command)[0].split(':')[1].strip() if switchport_cfg == 'Enabled': state = 'present' else: