mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
sub-interface support for nxos module (#37392)
* nxos sub-interface support Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * update l3_interface test Signed-off-by: Trishna Guha <trishnaguha17@gmail.com> * Add integration test Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
9940b5db9c
commit
6db3f522c8
5 changed files with 94 additions and 4 deletions
|
@ -302,7 +302,7 @@ def normalize_interface(name):
|
|||
def _get_number(name):
|
||||
digits = ''
|
||||
for char in name:
|
||||
if char.isdigit() or char == '/':
|
||||
if char.isdigit() or char in '/.':
|
||||
digits += char
|
||||
return digits
|
||||
|
||||
|
|
|
@ -122,7 +122,6 @@ def map_obj_to_commands(updates, module):
|
|||
if command:
|
||||
command.append('exit')
|
||||
command.insert(0, 'interface {0}'.format(name))
|
||||
command.insert(1, 'no switchport')
|
||||
commands.extend(command)
|
||||
|
||||
elif state == 'present' and obj_in_have:
|
||||
|
@ -135,10 +134,8 @@ def map_obj_to_commands(updates, module):
|
|||
if command:
|
||||
command.append('exit')
|
||||
command.insert(0, 'interface {0}'.format(name))
|
||||
command.insert(1, 'no switchport')
|
||||
elif not ipv4 and not ipv6:
|
||||
command.append('interface {0}'.format(name))
|
||||
command.append('no switchport')
|
||||
commands.extend(command)
|
||||
|
||||
return commands
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue