fix potential KeyError
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Tue, 18 Dec 2012 16:26:29 +0000 (11:26 -0500)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Tue, 18 Dec 2012 16:26:29 +0000 (11:26 -0500)
sfa/planetlab/plaggregate.py

index c07d9c8..ef1a5bb 100644 (file)
@@ -191,7 +191,7 @@ class PlAggregate:
                 interface['client_id'] = "%s:%s" % (node['node_id'], if_id)
             rspec_node['interfaces'].append(interface)
             if_count+=1
-        tags = [PLTag(node_tags[tag_id]) for tag_id in node['node_tag_ids']]
+        tags = [PLTag(node_tags[tag_id]) for tag_id in node['node_tag_ids'] if tag_id in node_tags]
         rspec_node['tags'] = tags
         return rspec_node