diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-01 21:43:03 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-01 11:43:03 -0700 |
| commit | a2ee09579a75165ae691efcbf3e952db83145b83 (patch) | |
| tree | 97b0b4d3e5aed3c1b491bd5b7cbc13b4d7688238 /plugins/modules/vyos_vlan.py | |
| parent | d3f981148e78c0dd31d35063f3407530278aa3a1 (diff) | |
| download | vyos.vyos-a2ee09579a75165ae691efcbf3e952db83145b83.tar.gz vyos.vyos-a2ee09579a75165ae691efcbf3e952db83145b83.zip | |
T8520: fix vlan purge generating invalid commands for bare interfaces (#463)
Co-authored-by: Daniil Baturin <daniil@baturin.org>
Diffstat (limited to 'plugins/modules/vyos_vlan.py')
| -rw-r--r-- | plugins/modules/vyos_vlan.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/plugins/modules/vyos_vlan.py b/plugins/modules/vyos_vlan.py index f0b68bc9..9d23cc7c 100644 --- a/plugins/modules/vyos_vlan.py +++ b/plugins/modules/vyos_vlan.py @@ -279,15 +279,11 @@ def map_config_to_obj(module): obj = {} eth = splitted_line[0].strip("'") - if eth.startswith("eth"): + if eth.startswith("eth") and "." in eth: obj["interfaces"] = [] - if "." in eth: - interface = eth.split(".")[0] - obj["interfaces"].append(interface) - obj["vlan_id"] = eth.split(".")[-1] - else: - obj["interfaces"].append(eth) - obj["vlan_id"] = None + interface = eth.split(".")[0] + obj["interfaces"].append(interface) + obj["vlan_id"] = eth.split(".")[-1] if splitted_line[1].strip("'") != "-": obj["address"] = splitted_line[1].strip("'") |
