Update ce_snmp_target_host to fix bugs (#61842)
This commit is contained in:
parent
a260209098
commit
027cd16b1a
1 changed files with 9 additions and 4 deletions
|
@ -405,7 +405,7 @@ class SnmpTargetHost(object):
|
||||||
|
|
||||||
find_flag = False
|
find_flag = False
|
||||||
for item in INTERFACE_TYPE:
|
for item in INTERFACE_TYPE:
|
||||||
if item in self.interface_name:
|
if item in self.interface_name.lower():
|
||||||
find_flag = True
|
find_flag = True
|
||||||
break
|
break
|
||||||
if not find_flag:
|
if not find_flag:
|
||||||
|
@ -629,6 +629,9 @@ class SnmpTargetHost(object):
|
||||||
if self.host_name:
|
if self.host_name:
|
||||||
self.end_state["target host info"] = self.end_netconf_cfg[
|
self.end_state["target host info"] = self.end_netconf_cfg[
|
||||||
"target_host_info"]
|
"target_host_info"]
|
||||||
|
if self.existing == self.end_state:
|
||||||
|
self.changed = False
|
||||||
|
self.updates_cmd = list()
|
||||||
|
|
||||||
def config_version_cli(self):
|
def config_version_cli(self):
|
||||||
""" Config version by cli """
|
""" Config version by cli """
|
||||||
|
@ -771,7 +774,7 @@ class SnmpTargetHost(object):
|
||||||
if self.security_model == "v3" and self.security_name_v3:
|
if self.security_model == "v3" and self.security_name_v3:
|
||||||
cmd += "params securityname %s %s " % (
|
cmd += "params securityname %s %s " % (
|
||||||
self.security_name_v3, self.security_model)
|
self.security_name_v3, self.security_model)
|
||||||
if self.security_level and self.security_level in ["authentication", "privacy "]:
|
if self.security_level and self.security_level in ["authentication", "privacy"]:
|
||||||
cmd += "%s" % self.security_level
|
cmd += "%s" % self.security_level
|
||||||
|
|
||||||
self.changed = True
|
self.changed = True
|
||||||
|
@ -815,8 +818,10 @@ class SnmpTargetHost(object):
|
||||||
if not self.address:
|
if not self.address:
|
||||||
cmd = "undo snmp-agent target-host host-name %s " % self.host_name
|
cmd = "undo snmp-agent target-host host-name %s " % self.host_name
|
||||||
else:
|
else:
|
||||||
cmd = "undo snmp-agent target-host trap address udp-domain %s " % self.address
|
if self.notify_type == "trap":
|
||||||
|
cmd = "undo snmp-agent target-host trap address udp-domain %s " % self.address
|
||||||
|
else:
|
||||||
|
cmd = "undo snmp-agent target-host inform address udp-domain %s " % self.address
|
||||||
if self.recv_port:
|
if self.recv_port:
|
||||||
cmd += "udp-port %s " % self.recv_port
|
cmd += "udp-port %s " % self.recv_port
|
||||||
if self.interface_name:
|
if self.interface_name:
|
||||||
|
|
Loading…
Reference in a new issue