Update ce_netstream_export to fix bugs (#61652)
* Update ce_netstream_export to fix bugs * Update ce_netstream_export to fix bugs
This commit is contained in:
parent
80fa2a0816
commit
8233389446
1 changed files with 8 additions and 6 deletions
|
@ -190,7 +190,7 @@ changed:
|
|||
|
||||
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
|
||||
|
||||
|
||||
|
@ -261,10 +261,12 @@ class NetstreamExport(object):
|
|||
def get_netstream_config(self):
|
||||
"""get current netstream configuration"""
|
||||
|
||||
flags = list()
|
||||
exp = " | inc ^netstream export"
|
||||
flags.append(exp)
|
||||
return get_config(self.module, flags)
|
||||
cmd = "display current-configuration | include ^netstream export"
|
||||
rc, out, err = exec_command(self.module, cmd)
|
||||
if rc != 0:
|
||||
self.module.fail_json(msg=err)
|
||||
config = str(out).strip()
|
||||
return config
|
||||
|
||||
def get_existing(self):
|
||||
"""get existing config"""
|
||||
|
@ -433,7 +435,7 @@ class NetstreamExport(object):
|
|||
|
||||
if cmd == 'netstream export ip version 5':
|
||||
cmd_tmp = "netstream export ip version"
|
||||
if is_config_exist(self.config, cmd_tmp):
|
||||
if cmd_tmp in self.config:
|
||||
if self.state == 'present':
|
||||
self.cli_add_command(cmd, False)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue