mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02: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(','):
|
||||
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)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue