Update ce_evpn_bgp to fix bugs (#61136)
This commit is contained in:
parent
1a8c1c7365
commit
90958b01c1
1 changed files with 15 additions and 9 deletions
|
@ -136,7 +136,7 @@ end_state:
|
|||
|
||||
import re
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.network.cloudengine.ce import get_config, load_config
|
||||
from ansible.module_utils.network.cloudengine.ce import exec_command, load_config
|
||||
from ansible.module_utils.network.cloudengine.ce import ce_argument_spec
|
||||
|
||||
|
||||
|
@ -238,18 +238,20 @@ class EvpnBgp(object):
|
|||
def get_evpn_overlay_config(self):
|
||||
"""get evpn-overlay enable configuration"""
|
||||
|
||||
flags = list()
|
||||
exp = "| ignore-case include evpn-overlay enable"
|
||||
flags.append(exp)
|
||||
return get_config(self.module, flags)
|
||||
cmd = "display current-configuration | include ^evpn-overlay enable"
|
||||
rc, out, err = exec_command(self.module, cmd)
|
||||
if rc != 0:
|
||||
self.module.fail_json(msg=err)
|
||||
return out
|
||||
|
||||
def get_current_config(self):
|
||||
"""get current configuration"""
|
||||
|
||||
flags = list()
|
||||
exp = "| ignore-case section include bgp %s" % self.bgp_instance
|
||||
flags.append(exp)
|
||||
return get_config(self.module, flags)
|
||||
cmd = "display current-configuration | section include bgp %s" % self.bgp_instance
|
||||
rc, out, err = exec_command(self.module, cmd)
|
||||
if rc != 0:
|
||||
self.module.fail_json(msg=err)
|
||||
return out
|
||||
|
||||
def cli_add_command(self, command, undo=False):
|
||||
"""add command to self.update_cmd and self.commands"""
|
||||
|
@ -501,6 +503,10 @@ class EvpnBgp(object):
|
|||
if not self.config:
|
||||
return
|
||||
|
||||
self.config_list = self.config.split('l2vpn-family evpn')
|
||||
if len(self.config_list) == 2:
|
||||
self.l2vpn_evpn_exist = True
|
||||
|
||||
if self.bgp_instance:
|
||||
self.end_state["bgp_instance"] = self.bgp_instance
|
||||
|
||||
|
|
Loading…
Reference in a new issue