ListResounces will only return the nodes a sliver has allocated
[sfa.git] / sfa / plc / aggregate.py
index 8f6335f..ef4705b 100644 (file)
@@ -105,10 +105,13 @@ class Aggregate:
             # only doing this becuase protogeni rspec needs
             # to advertise available initscripts 
             node['pl_initscripts'] = self.pl_initscripts
-            if not node['slice_ids_whitelist']:
+
+            if slice and node['node_id'] in slice['node_ids']:
                 valid_nodes.append(node)
             elif slice and slice['slice_id'] in node['slice_ids_whitelist']:
                 valid_nodes.append(node)
+            elif not slice and not node['slice_ids_whitelist']:
+                valid_nodes.append(node)
     
         rspec.add_nodes(valid_nodes)
         rspec.add_interfaces(self.interfaces.values())