Skip to content
Snippets Groups Projects
Commit 3bb4c0c7 authored by Rob Sherwood's avatar Rob Sherwood
Browse files

topology ui bugfix: don't assume hosts have ips

topology viewer was dying if floodlight had not yet discovered
an IP address for every host.
parent 07c2b20a
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,11 @@ window.TopologyView = Backbone.View.extend({
for (var i = 0; i < this.hosts.length; i++) {
host = this.hosts[i];
host.name = host.attributes['network-addresses'][0]['ip'] + "\n" + host.id;
if ('ip' in host.attributes['network-addresses'][0]) {
host.name = host.attributes['network-addresses'][0]['ip'] + "\n" + host.id;
} else {
host.name = host.id;
}
host.group = 2;
console.log(host);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment