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.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 from ansible.module_utils.network.cloudengine.ce import ce_argument_spec
@ -153,11 +153,11 @@ class EvpnGlobal(object):
""" get current EVPN global configuration""" """ get current EVPN global configuration"""
self.global_info['evpnOverLay'] = 'disable' self.global_info['evpnOverLay'] = 'disable'
flags = list() cmd = "display current-configuration | include ^evpn-overlay enable"
exp = " | include evpn-overlay enable" rc, out, err = exec_command(self.module, cmd)
flags.append(exp) if rc != 0:
config = get_config(self.module, flags) self.module.fail_json(msg=err)
if config: if out:
self.global_info['evpnOverLay'] = 'enable' self.global_info['evpnOverLay'] = 'enable'
def get_existing(self): def get_existing(self):