get_rspec() should return an empty rspec when the slice has no nodes
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Thu, 9 Feb 2012 00:40:25 +0000 (19:40 -0500)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Thu, 9 Feb 2012 00:40:25 +0000 (19:40 -0500)
sfa/plc/plaggregate.py

index 1cace7a..55e6291 100644 (file)
@@ -136,6 +136,11 @@ class PlAggregate:
         return (slice, slivers)
 
     def get_nodes_and_links(self, slice=None,slivers=[], options={}):
+        # if we are dealing with a slice that has no node just return 
+        # and empty list    
+        if slice is not None and not slice['node_ids']:
+            return ([],[])
+
         filter = {}
         tags_filter = {}
         if slice and 'node_ids' in slice and slice['node_ids']: