ce_snmp_target_host: update to fix bug: None has no 'lower()' function. (#57904)

* update to fix bug: None has not 'lower()' function.

* add a changelog fragment.

* update changlog fragment.

* Update 57904-ce_snmp_target_host.yml
This commit is contained in:
YuandongXu 2019-06-29 15:36:29 +08:00 committed by René Moser
parent 8cfd0ba039
commit 78c8ee9261
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,3 @@
---
bugfixes:
- ce_snmp_target_host - None has no 'lower()' attribute.

View file

@ -493,7 +493,10 @@ class SnmpTargetHost(object):
same_flag = False
if "interface-name" in tmp.keys():
if tmp["interface-name"].lower() != self.interface_name.lower():
if tmp.get("interface-name") is not None:
if tmp["interface-name"].lower() != self.interface_name.lower():
same_flag = False
else:
same_flag = False
if same_flag: