Update ce_evpn_global to fix bugs (#61013)

This commit is contained in:
yanzhangi 2019-09-18 10:52:32 +08:00 committed by ansibot
parent 80ead00838
commit 3cde0b5693

View file

@ -102,7 +102,7 @@ changed:
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
@ -153,11 +153,11 @@ class EvpnGlobal(object):
""" get current EVPN global configuration"""
self.global_info['evpnOverLay'] = 'disable'
flags = list()
exp = " | include evpn-overlay enable"
flags.append(exp)
config = get_config(self.module, flags)
if config:
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)
if out:
self.global_info['evpnOverLay'] = 'enable'
def get_existing(self):