mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Fixes ios_l2_interface and ios_vlan not working on certain interface types issue (#43819)
* Fixes #43654 and #43582 * Remove q statement * Fix shippable errors * Fix more shippable errors * Fix unittest
This commit is contained in:
parent
e188073629
commit
b14f256d41
3 changed files with 51 additions and 3 deletions
|
@ -118,7 +118,7 @@ from ansible.module_utils.network.ios.ios import ios_argument_spec
|
|||
|
||||
def get_interface_type(interface):
|
||||
intf_type = 'unknown'
|
||||
if interface.upper()[:2] in ('ET', 'GI'):
|
||||
if interface.upper()[:2] in ('ET', 'GI', 'FA', 'TE', 'FO'):
|
||||
intf_type = 'ethernet'
|
||||
elif interface.upper().startswith('VL'):
|
||||
intf_type = 'svi'
|
||||
|
|
|
@ -103,7 +103,7 @@ from copy import deepcopy
|
|||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.network.common.utils import remove_default_spec
|
||||
from ansible.module_utils.network.ios.ios import load_config, run_commands
|
||||
from ansible.module_utils.network.ios.ios import load_config, run_commands, normalize_interface
|
||||
from ansible.module_utils.network.ios.ios import ios_argument_spec, check_args
|
||||
|
||||
|
||||
|
@ -231,7 +231,7 @@ def parse_to_logical_rows(out):
|
|||
|
||||
|
||||
def map_ports_str_to_list(ports_str):
|
||||
return list(filter(bool, (p.strip().replace('Gi', 'GigabitEthernet') for p in ports_str.split(', '))))
|
||||
return list(filter(bool, (normalize_interface(p.strip()) for p in ports_str.split(', '))))
|
||||
|
||||
|
||||
def parse_to_obj(logical_rows):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue