Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ce_vrf_af to fix bugs #61683

Merged
merged 1 commit into from
Sep 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions lib/ansible/modules/network/cloudengine/ce_vrf_af.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,11 @@ def set_update_cmd(self):
""" 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':
Expand All @@ -512,18 +517,18 @@ def set_update_cmd(self):
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':
Expand Down