diff options
author | yanzhangi <51999930+yanzhangi@users.noreply.github.com> | 2019-10-12 03:41:29 +0800 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2019-10-12 09:17:09 -0700 |
commit | 46926b628e86947c9af31fe55c607d32a01c3e85 (patch) | |
tree | 641874bec18abf360879633d3a5a7db983e61b72 | |
parent | c8790739e7790901f3f4b2a50a23556151b89b5d (diff) | |
download | ansible-46926b628e86947c9af31fe55c607d32a01c3e85.tar.gz |
[Backport/2.9/61683]Update ce_vrf_af to fix bugs (#62654)
* Update ce_vrf_af to fix bugs
(cherry picked from commit 0c65db1a2337f98a307f3276b308cf54c66ebf83)
* Update ce_vrf_af modified information
-rw-r--r-- | changelogs/fragments/61683-ce_vrf_af-to-fix-bugs.yml | 2 | ||||
-rw-r--r-- | lib/ansible/modules/network/cloudengine/ce_vrf_af.py | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/changelogs/fragments/61683-ce_vrf_af-to-fix-bugs.yml b/changelogs/fragments/61683-ce_vrf_af-to-fix-bugs.yml new file mode 100644 index 0000000000..035d625708 --- /dev/null +++ b/changelogs/fragments/61683-ce_vrf_af-to-fix-bugs.yml @@ -0,0 +1,2 @@ +bugfixes: +- ce_vrf_af - update to fix some bugs - Add some update statements. (https://github.com/ansible/ansible/pull/61683) diff --git a/lib/ansible/modules/network/cloudengine/ce_vrf_af.py b/lib/ansible/modules/network/cloudengine/ce_vrf_af.py index c019e1af8d..c89ed2c5f5 100644 --- a/lib/ansible/modules/network/cloudengine/ce_vrf_af.py +++ b/lib/ansible/modules/network/cloudengine/ce_vrf_af.py @@ -494,6 +494,11 @@ class VrfAf(object): """ set update command""" if not self.changed: return + if self.vpn_target_type: + if self.vpn_target_type == "export_extcommunity": + vpn_target_type = "export-extcommunity" + else: + vpn_target_type = "import-extcommunity" if self.state == "present": self.updates_cmd.append('ip vpn-instance %s' % (self.vrf)) if self.vrf_aftype == 'ipv4uni': @@ -512,18 +517,18 @@ class VrfAf(object): if not self.is_vrf_rt_exist(): if self.evpn is False: self.updates_cmd.append( - 'vpn-target %s %s' % (self.vpn_target_value, self.vpn_target_type)) + 'vpn-target %s %s' % (self.vpn_target_value, vpn_target_type)) else: self.updates_cmd.append( - 'vpn-target %s %s evpn' % (self.vpn_target_value, self.vpn_target_type)) + 'vpn-target %s %s evpn' % (self.vpn_target_value, vpn_target_type)) elif self.vpn_target_state == "absent": if self.is_vrf_rt_exist(): if self.evpn is False: self.updates_cmd.append( - 'undo vpn-target %s %s' % (self.vpn_target_value, self.vpn_target_type)) + 'undo vpn-target %s %s' % (self.vpn_target_value, vpn_target_type)) else: self.updates_cmd.append( - 'undo vpn-target %s %s evpn' % (self.vpn_target_value, self.vpn_target_type)) + 'undo vpn-target %s %s evpn' % (self.vpn_target_value, vpn_target_type)) else: self.updates_cmd.append('ip vpn-instance %s' % (self.vrf)) if self.vrf_aftype == 'ipv4uni': |