fix potential KeyError
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Thu, 10 Jan 2013 19:50:04 +0000 (14:50 -0500)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Thu, 10 Jan 2013 19:50:04 +0000 (14:50 -0500)
sfa/planetlab/plaggregate.py

index a16bf67..47c637b 100644 (file)
@@ -238,7 +238,8 @@ class PlAggregate:
                 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
             if node['node_id'] in slivers:
                 # add sliver info