GetSlices ouputs a list of dictionaries
[sfa.git] / geni / util / slices.py
index 1ba2f95..b18c869 100644 (file)
@@ -268,9 +268,9 @@ class Slices(SimpleStorage):
 
     def start_slice_smgr(self, hrn):
         credential = self.api.getCredential()
-        aggregates = Aggregates()
+        aggregates = Aggregates(self.api)
         for aggregate in aggregates:
-            aggreegates[aggregate].start_slice(credential, hrn)
+            aggregates[aggregate].start_slice(credential, hrn)
         return 1
 
 
@@ -285,7 +285,7 @@ class Slices(SimpleStorage):
         slices = self.api.plshell.GetSlices(self.api.plauth, {'name': slicename}, ['slice_id'])
         if not slices:
             raise RecordNotFound(hrn)
-        slice_id = slices[0]
+        slice_id = slices[0]['slice_id']
         attributes = self.api.plshell.GetSliceAttributes(self.api.plauth, {'slice_id': slice_id, 'name': 'enabled'}, ['slice_attribute_id'])
         attribute_id = attributes[0]['slice_attribute_id']
         self.api.plshell.UpdateSliceAttribute(self.api.plauth, attribute_id, "0")
@@ -293,7 +293,7 @@ class Slices(SimpleStorage):
 
     def stop_slice_smgr(self, hrn):
         credential = self.api.getCredential()
-        aggregates = Aggregates()
+        aggregates = Aggregates(self.api)
         for aggregate in aggregates:
-            aggregate[aggregate].stop_slice(credential, hrn)  
+            aggregates[aggregate].stop_slice(credential, hrn)