Merge branch 'master' of ssh://git.onelab.eu/git/sfa
[sfa.git] / sfa / planetlab / plaggregate.py
index b3ae459..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
@@ -259,6 +260,9 @@ class PlAggregate:
 
     def get_leases(self, slice_xrn=None, slice=None, options={}):
         
+        if slice_xrn and not slice:
+            return []
+
         now = int(time.time())
         filter={}
         filter.update({'clip':now})