From 5465dca7ec304ef762a2b6cc40150b95fb1a415e Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Thu, 12 Jul 2018 15:20:33 +0200 Subject: [PATCH] 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. --- lib/ansible/modules/network/aci/aci_bd_subnet.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/network/aci/aci_bd_subnet.py b/lib/ansible/modules/network/aci/aci_bd_subnet.py index 5117d6325c..3f63f09d82 100644 --- a/lib/ansible/modules/network/aci/aci_bd_subnet.py +++ b/lib/ansible/modules/network/aci/aci_bd_subnet.py @@ -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: