mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
FIX ISSUE:#43878 when the vlans string have a final comma. (#43879)
This commit is contained in:
committed by
Nilashish Chakraborty
parent
167c389270
commit
401c45384e
@@ -303,11 +303,12 @@ def vlan_range_to_list(vlans):
|
||||
for part in vlans.split(','):
|
||||
if part.lower() == 'none':
|
||||
break
|
||||
if '-' in part:
|
||||
start, stop = (int(i) for i in part.split('-'))
|
||||
result.extend(range(start, stop + 1))
|
||||
else:
|
||||
result.append(int(part))
|
||||
if part:
|
||||
if '-' in part:
|
||||
start, stop = (int(i) for i in part.split('-'))
|
||||
result.extend(range(start, stop + 1))
|
||||
else:
|
||||
result.append(int(part))
|
||||
return sorted(result)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user