mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix for Bug#54050 (#54863)
* testing * Fixed bug #54050 * fixed pylint issues * removed Reamde.RST changes
This commit is contained in:
parent
9b339de7b6
commit
d0ae686525
1 changed files with 12 additions and 9 deletions
|
@ -213,7 +213,10 @@ def map_config_to_obj(module):
|
||||||
for item in set(match):
|
for item in set(match):
|
||||||
command = {'command': 'show interfaces {0} switchport | include Switchport'.format(item),
|
command = {'command': 'show interfaces {0} switchport | include Switchport'.format(item),
|
||||||
'output': 'text'}
|
'output': 'text'}
|
||||||
switchport_cfg = run_commands(module, command)[0].split(':')[1].strip()
|
command_result = run_commands(module, command)
|
||||||
|
if command_result[0] != "":
|
||||||
|
switchport_cfg = command_result[0].split(':')[1].strip()
|
||||||
|
|
||||||
if switchport_cfg == 'Enabled':
|
if switchport_cfg == 'Enabled':
|
||||||
state = 'present'
|
state = 'present'
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue