Backport PR to resolve NoneType error in issue 57711 (#58706)

* fix 57711 (#58618)

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
(cherry picked from commit 8b844b67b5)

* changelog file
This commit is contained in:
Sumit Jaiswal 2019-07-17 02:52:19 +05:30 committed by Toshio Kuratomi
parent 396e48b36e
commit 5fb2a0ae2d
2 changed files with 8 additions and 4 deletions

View file

@ -0,0 +1,3 @@
bugfixes:
- To resolve NoneType error as it was missing NoneType check for l3protocol param in aci_l3out.
(https://github.com/ansible/ansible/pull/58618).

View file

@ -280,10 +280,11 @@ def main():
state = module.params['state'] state = module.params['state']
tenant = module.params['tenant'] tenant = module.params['tenant']
if 'eigrp' in l3protocol and asn is None: if l3protocol:
module.fail_json(msg="Parameter 'asn' is required when l3protocol is 'eigrp'") if 'eigrp' in l3protocol and asn is None:
if 'eigrp' not in l3protocol and asn is not None: module.fail_json(msg="Parameter 'asn' is required when l3protocol is 'eigrp'")
module.warn("Parameter 'asn' is only applicable when l3protocol is 'eigrp'. The ASN will be ignored") if 'eigrp' not in l3protocol and asn is not None:
module.warn("Parameter 'asn' is only applicable when l3protocol is 'eigrp'. The ASN will be ignored")
enforce_ctrl = '' enforce_ctrl = ''
if enforceRtctrl is not None: if enforceRtctrl is not None: