Skip to content

Commit

Permalink
fix the error occured by Zabbix API specification changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ike-dai committed Mar 17, 2014
1 parent 1a6da70 commit 8635501
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions hyclops/connector/vsphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,11 @@ def create_zabbix_host(self, owner_hostname, hostname, node):

def update_zabbix_host(self, owner_hostname, hostname, node, host):
visible_name = self.adjust_string_length(owner_hostname, node.name, self.VISIBLE_NAME_MAX_LENGTH)
#if node.public_ips and [interface for interface in host["interfaces"].values() if interface["dns"] == "dummy-interface.invalid"]:
if node.public_ips and [interface for interface in host["interfaces"] if interface["dns"] == "dummy-interface.invalid"]:
interfaces = host["interfaces"]
if isinstance(interfaces, dict):
interfaces = interfaces.values()
if node.public_ips and [interface for interface in interfaces if interface["dns"] == "dummy-interface.invalid"]:
for type in [1, 2]:
interfaces = host["interfaces"]
if isinstance(interfaces, dict):
interfaces = interfaces.values()
old_interfaces = [interface for interface in interfaces if int(interface["type"]) == type]
old_interfaces = sorted(old_interfaces, key=lambda x: x["interfaceid"])
is_main = False if old_interfaces else True
Expand Down

0 comments on commit 8635501

Please sign in to comment.