mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-29 16:11:22 -07:00
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:
parent
7e42e88cc1
commit
5465dca7ec
1 changed files with 5 additions and 4 deletions
|
@ -358,10 +358,11 @@ def main():
|
||||||
route_profile = module.params['route_profile']
|
route_profile = module.params['route_profile']
|
||||||
route_profile_l3_out = module.params['route_profile_l3_out']
|
route_profile_l3_out = module.params['route_profile_l3_out']
|
||||||
scope = module.params['scope']
|
scope = module.params['scope']
|
||||||
if 'private' in scope and 'public' in scope:
|
if scope is not None:
|
||||||
module.fail_json(msg="Parameter 'scope' cannot be both 'private' and 'public', got: %s" % scope)
|
if 'private' in scope and 'public' in scope:
|
||||||
else:
|
module.fail_json(msg="Parameter 'scope' cannot be both 'private' and 'public', got: %s" % scope)
|
||||||
scope = ','.join(sorted(scope))
|
else:
|
||||||
|
scope = ','.join(sorted(scope))
|
||||||
state = module.params['state']
|
state = module.params['state']
|
||||||
subnet_control = module.params['subnet_control']
|
subnet_control = module.params['subnet_control']
|
||||||
if subnet_control:
|
if subnet_control:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue