mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
fix nxos_vrf and migrate get_interface_type to module_utils (#40825)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
This commit is contained in:
parent
45c6fa9784
commit
b4baa2d484
11 changed files with 41 additions and 180 deletions
|
@ -203,6 +203,7 @@ from copy import deepcopy
|
|||
|
||||
from ansible.module_utils.network.nxos.nxos import load_config, run_commands
|
||||
from ansible.module_utils.network.nxos.nxos import nxos_argument_spec, normalize_interface
|
||||
from ansible.module_utils.network.nxos.nxos import get_interface_type
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.network.common.utils import conditional, remove_default_spec
|
||||
|
||||
|
@ -231,27 +232,6 @@ def search_obj_in_list(name, lst):
|
|||
return None
|
||||
|
||||
|
||||
def get_interface_type(interface):
|
||||
"""Gets the type of interface
|
||||
"""
|
||||
if interface.upper().startswith('ET'):
|
||||
return 'ethernet'
|
||||
elif interface.upper().startswith('VL'):
|
||||
return 'svi'
|
||||
elif interface.upper().startswith('LO'):
|
||||
return 'loopback'
|
||||
elif interface.upper().startswith('MG'):
|
||||
return 'management'
|
||||
elif interface.upper().startswith('MA'):
|
||||
return 'management'
|
||||
elif interface.upper().startswith('PO'):
|
||||
return 'portchannel'
|
||||
elif interface.upper().startswith('NV'):
|
||||
return 'nve'
|
||||
else:
|
||||
return 'unknown'
|
||||
|
||||
|
||||
def get_interfaces_dict(module):
|
||||
"""Gets all active interfaces on a given switch
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue