aci_bd_subnet: Support parameter scope not set (#42675)

If parameter scope is not set (is None) the usual handling of lists does
not apply, and should be avoided or we get an exception.

This needs to be backported to earlier versions of Ansible.
This commit is contained in:
Dag Wieers 2018-07-12 15:20:33 +02:00 committed by GitHub
parent 7e42e88cc1
commit 5465dca7ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -358,10 +358,11 @@ def main():
route_profile = module.params['route_profile']
route_profile_l3_out = module.params['route_profile_l3_out']
scope = module.params['scope']
if 'private' in scope and 'public' in scope:
module.fail_json(msg="Parameter 'scope' cannot be both 'private' and 'public', got: %s" % scope)
else:
scope = ','.join(sorted(scope))
if scope is not None:
if 'private' in scope and 'public' in scope:
module.fail_json(msg="Parameter 'scope' cannot be both 'private' and 'public', got: %s" % scope)
else:
scope = ','.join(sorted(scope))
state = module.params['state']
subnet_control = module.params['subnet_control']
if subnet_control: