Skip to content

Commit

Permalink
fix eos_l2_interface insufficient commands (#50754)
Browse files Browse the repository at this point in the history
  • Loading branch information
tetsuyasodo authored and trishnaguha committed Jan 10, 2019
1 parent 6995e04 commit 1d4dbd7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ansible/modules/network/eos/eos_l2_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,18 @@ def map_obj_to_commands(updates, module):
if obj_in_have['mode'] == 'access':
commands.append('no switchport access vlan {0}'.format(obj_in_have['access_vlan']))
if native_vlan:
commands.append('switchport mode trunk')
commands.append('switchport trunk native vlan {0}'.format(native_vlan))
if trunk_allowed_vlans:
commands.append('switchport mode trunk')
commands.append('switchport trunk allowed vlan {0}'.format(trunk_allowed_vlans))
else:
if obj_in_have['native_vlan']:
commands.append('no switchport trunk native vlan {0}'.format(obj_in_have['native_vlan']))
commands.append('no switchport mode trunk')
if obj_in_have['trunk_allowed_vlans']:
commands.append('no switchport trunk allowed vlan {0}'.format(obj_in_have['trunk_allowed_vlans']))
commands.append('no switchport mode trunk')
commands.append('switchport access vlan {0}'.format(access_vlan))
else:
if mode == 'access':
Expand Down

0 comments on commit 1d4dbd7

Please sign in to comment.