mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 15:11:23 -07:00
FIX ISSUE:#43878 when the vlans string have a final comma. (#43879)
This commit is contained in:
parent
167c389270
commit
401c45384e
1 changed files with 6 additions and 5 deletions
|
@ -303,11 +303,12 @@ def vlan_range_to_list(vlans):
|
||||||
for part in vlans.split(','):
|
for part in vlans.split(','):
|
||||||
if part.lower() == 'none':
|
if part.lower() == 'none':
|
||||||
break
|
break
|
||||||
if '-' in part:
|
if part:
|
||||||
start, stop = (int(i) for i in part.split('-'))
|
if '-' in part:
|
||||||
result.extend(range(start, stop + 1))
|
start, stop = (int(i) for i in part.split('-'))
|
||||||
else:
|
result.extend(range(start, stop + 1))
|
||||||
result.append(int(part))
|
else:
|
||||||
|
result.append(int(part))
|
||||||
return sorted(result)
|
return sorted(result)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue