1
0
Fork 0
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:
Dag Wieers 2018-08-09 02:27:03 +02:00 committed by GitHub
parent cb23a6fc0f
commit 02b5057392
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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]