Update ce_netstream_aging to fix bugs (#61653)
* Update ce_netstream_aging to fix bugs * Update ce_netstream_aging to fix bugs
This commit is contained in:
parent
027cd16b1a
commit
80fa2a0816
1 changed files with 12 additions and 9 deletions
|
@ -192,7 +192,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
|
||||||
|
|
||||||
|
|
||||||
|
@ -273,10 +273,12 @@ class NetStreamAging(object):
|
||||||
inactive_tmp["vxlan"] = "30"
|
inactive_tmp["vxlan"] = "30"
|
||||||
tcp_tmp["ip"] = "absent"
|
tcp_tmp["ip"] = "absent"
|
||||||
tcp_tmp["vxlan"] = "absent"
|
tcp_tmp["vxlan"] = "absent"
|
||||||
flags = list()
|
|
||||||
exp = " | ignore-case include netstream timeout"
|
cmd = "display current-configuration | include ^netstream timeout"
|
||||||
flags.append(exp)
|
rc, out, err = exec_command(self.module, cmd)
|
||||||
config = get_config(self.module, flags)
|
if rc != 0:
|
||||||
|
self.module.fail_json(msg=err)
|
||||||
|
config = str(out).strip()
|
||||||
if config:
|
if config:
|
||||||
config = config.lstrip()
|
config = config.lstrip()
|
||||||
config_list = config.split('\n')
|
config_list = config.split('\n')
|
||||||
|
@ -313,10 +315,11 @@ class NetStreamAging(object):
|
||||||
inactive_tmp["vxlan"] = "30"
|
inactive_tmp["vxlan"] = "30"
|
||||||
tcp_tmp["ip"] = "absent"
|
tcp_tmp["ip"] = "absent"
|
||||||
tcp_tmp["vxlan"] = "absent"
|
tcp_tmp["vxlan"] = "absent"
|
||||||
flags = list()
|
cmd = "display current-configuration | include ^netstream timeout"
|
||||||
exp = " | ignore-case include netstream timeout"
|
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)
|
||||||
|
config = str(out).strip()
|
||||||
if config:
|
if config:
|
||||||
config = config.lstrip()
|
config = config.lstrip()
|
||||||
config_list = config.split('\n')
|
config_list = config.split('\n')
|
||||||
|
|
Loading…
Reference in a new issue