From c1126afbfb70c81310d9110cb6d362961a183255 Mon Sep 17 00:00:00 2001 From: Andrey Klychkov Date: Tue, 17 Sep 2019 15:34:07 +0300 Subject: [PATCH] ce_bgp_neighbor_af: fix a typo in module's parameter (#62403) * ce_bgp_neighbor_af: fix a typo in module's parameter * ce_bgp_neighbor_af: fix a typo in module's parameter, add version_added and changelog * ce_bgp_neighbor_af: fix a typo in module's parameter, add aliase --- ...-ce_bgp_neighbor_af_fix_parameter_name.yml | 2 ++ .../network/cloudengine/ce_bgp_neighbor_af.py | 29 ++++++++++--------- 2 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 changelogs/fragments/62403-ce_bgp_neighbor_af_fix_parameter_name.yml diff --git a/changelogs/fragments/62403-ce_bgp_neighbor_af_fix_parameter_name.yml b/changelogs/fragments/62403-ce_bgp_neighbor_af_fix_parameter_name.yml new file mode 100644 index 00000000000..48cdb518d02 --- /dev/null +++ b/changelogs/fragments/62403-ce_bgp_neighbor_af_fix_parameter_name.yml @@ -0,0 +1,2 @@ +minor_changes: +- ce_bgp_neighbor_af - Rename the parameter ``redirect_ip_vaildation`` to ``redirect_ip_validation`` (https://github.com/ansible/ansible/pull/62403). diff --git a/lib/ansible/modules/network/cloudengine/ce_bgp_neighbor_af.py b/lib/ansible/modules/network/cloudengine/ce_bgp_neighbor_af.py index 33f8b1b233a..4a7be01ca6e 100644 --- a/lib/ansible/modules/network/cloudengine/ce_bgp_neighbor_af.py +++ b/lib/ansible/modules/network/cloudengine/ce_bgp_neighbor_af.py @@ -171,11 +171,12 @@ options: - Redirect ip. default: no_use choices: ['no_use','true','false'] - redirect_ip_vaildation: + redirect_ip_validation: description: - - Redirect ip vaildation. + - Redirect ip validation. default: no_use choices: ['no_use','true','false'] + aliases: ['redirect_ip_vaildation'] reflect_client: description: - If the value is true, the local device functions as the route reflector and a peer functions @@ -1095,8 +1096,8 @@ class BgpNeighborAf(object): else: need_cfg = True - redirect_ip_vaildation = module.params['redirect_ip_vaildation'] - if redirect_ip_vaildation != 'no_use': + redirect_ip_validation = module.params['redirect_ip_validation'] + if redirect_ip_validation != 'no_use': conf_str = CE_GET_BGP_PEER_AF_HEADER % ( vrf_name, af_type, remote_address) + "" + CE_GET_BGP_PEER_AF_TAIL @@ -1109,10 +1110,10 @@ class BgpNeighborAf(object): r'.*(.*).*', recv_xml) if re_find: - result["redirect_ip_vaildation"] = re_find + result["redirect_ip_validation"] = re_find result["vrf_name"] = vrf_name result["af_type"] = af_type - if re_find[0] != redirect_ip_vaildation: + if re_find[0] != redirect_ip_validation: need_cfg = True else: need_cfg = True @@ -2064,9 +2065,9 @@ class BgpNeighborAf(object): if redirect_ip != 'no_use': conf_str += "%s" % redirect_ip - redirect_ip_vaildation = module.params['redirect_ip_vaildation'] - if redirect_ip_vaildation != 'no_use': - conf_str += "%s" % redirect_ip_vaildation + redirect_ip_validation = module.params['redirect_ip_validation'] + if redirect_ip_validation != 'no_use': + conf_str += "%s" % redirect_ip_validation reflect_client = module.params['reflect_client'] if reflect_client != 'no_use': @@ -2314,7 +2315,9 @@ def main(): route_limit_idle_timeout=dict(type='str'), rt_updt_interval=dict(type='str'), redirect_ip=dict(type='str', default='no_use', choices=['no_use', 'true', 'false']), - redirect_ip_vaildation=dict(type='str', default='no_use', choices=['no_use', 'true', 'false']), + redirect_ip_validation=dict( + type='str', default='no_use', + choices=['no_use', 'true', 'false'], aliases=['redirect_ip_vaildation']), reflect_client=dict(type='str', default='no_use', choices=['no_use', 'true', 'false']), substitute_as_enable=dict(type='str', default='no_use', choices=['no_use', 'true', 'false']), import_rt_policy_name=dict(type='str'), @@ -2377,7 +2380,7 @@ def main(): route_limit_idle_timeout = module.params['route_limit_idle_timeout'] rt_updt_interval = module.params['rt_updt_interval'] redirect_ip = module.params['redirect_ip'] - redirect_ip_vaildation = module.params['redirect_ip_vaildation'] + redirect_ip_validation = module.params['redirect_ip_validation'] reflect_client = module.params['reflect_client'] substitute_as_enable = module.params['substitute_as_enable'] import_rt_policy_name = module.params['import_rt_policy_name'] @@ -2460,8 +2463,8 @@ def main(): proposed["rt_updt_interval"] = rt_updt_interval if redirect_ip != 'no_use': proposed["redirect_ip"] = redirect_ip - if redirect_ip_vaildation != 'no_use': - proposed["redirect_ip_vaildation"] = redirect_ip_vaildation + if redirect_ip_validation != 'no_use': + proposed["redirect_ip_validation"] = redirect_ip_validation if reflect_client != 'no_use': proposed["reflect_client"] = reflect_client if substitute_as_enable != 'no_use':