mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Support dash-separated leaf IDs (as documented) (#43846)
This commit is contained in:
parent
cb23a6fc0f
commit
02b5057392
1 changed files with 5 additions and 2 deletions
|
@ -312,8 +312,11 @@ def main():
|
||||||
pod_id = module.params['pod_id']
|
pod_id = module.params['pod_id']
|
||||||
leafs = module.params['leafs']
|
leafs = module.params['leafs']
|
||||||
if leafs is not None:
|
if leafs is not None:
|
||||||
|
# Process leafs, and support dash-delimited leafs
|
||||||
|
leafs = []
|
||||||
|
for leaf in module.params['leafs']:
|
||||||
# Users are likely to use integers for leaf IDs, which would raise an exception when using the join method
|
# Users are likely to use integers for leaf IDs, which would raise an exception when using the join method
|
||||||
leafs = [str(leaf) for leaf in module.params['leafs']]
|
leafs.extend(str(leaf).split('-'))
|
||||||
if len(leafs) == 1:
|
if len(leafs) == 1:
|
||||||
if interface_type != 'vpc':
|
if interface_type != 'vpc':
|
||||||
leafs = leafs[0]
|
leafs = leafs[0]
|
||||||
|
|
Loading…
Reference in a new issue