From 5f4173b8bf05dadc89a9bf2466768a9a8b8da88c Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Wed, 19 Sep 2018 12:47:44 +0200 Subject: [PATCH] A few small fixes --- lib/ansible/modules/network/aci/aci_l3out.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/network/aci/aci_l3out.py b/lib/ansible/modules/network/aci/aci_l3out.py index 8704648b3f4..68e43999386 100644 --- a/lib/ansible/modules/network/aci/aci_l3out.py +++ b/lib/ansible/modules/network/aci/aci_l3out.py @@ -61,7 +61,7 @@ options: description: - Routing protocol for the L3Out type: list - choices: [ static, bgp, eigrp, ospf, pim ] + choices: [ bgp, eigrp, ospf, pim, static ] asn: description: - The AS number for the L3Out. Only applicable when using 'eigrp' as the l3protocol @@ -239,7 +239,7 @@ def main(): choices=['AF11', 'AF12', 'AF13', 'AF21', 'AF22', 'AF23', 'AF31', 'AF32', 'AF33', 'AF41', 'AF42', 'AF43', 'CS0', 'CS1', 'CS2', 'CS3', 'CS4', 'CS5', 'CS6', 'CS7', 'EF', 'VA', 'unspecified'], aliases=['target']), - l3protocol=dict(type='list', choices=['static', 'bgp', 'eigrp', 'ospf', 'pim']), + l3protocol=dict(type='list', choices=['bgp', 'eigrp', 'ospf', 'pim', 'static']), asn=dict(type='int', aliases=['as_number']), state=dict(type='str', default='present', choices=['absent', 'present', 'query']) ) @@ -266,10 +266,10 @@ def main(): state = module.params['state'] tenant = module.params['tenant'] - if asn and 'eigrp' not in l3protocol: - module._warnings = ["Parameter 'asn' is only applicable when l3protocol is 'eigrp'. The ASN will be ignored"] - if not asn and 'eigrp' in l3protocol: + if 'eigrp' in l3protocol and asn is None: module.fail_json(msg="Parameter 'asn' is required when l3protocol is 'eigrp'") + 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 = '' if enforceRtctrl is not None: