updated renew(), delete(), allocate(), provision()
[sfa.git] / sfa / managers / slice_manager.py
index 75dbec4..dcd5e5e 100644 (file)
@@ -337,9 +337,9 @@ class SliceManager:
     
     
     # first draft at a merging SliverStatus
-    def SliverStatus(self, api, slice_xrn, creds, options):
-        def _SliverStatus(server, xrn, creds, options):
-            return server.SliverStatus(xrn, creds, options)
+    def Status(self, api, slice_xrn, creds, options):
+        def _Status(server, xrn, creds, options):
+            return server.Status(xrn, creds, options)
 
         call_id = options.get('call_id') 
         if Callids().already_handled(call_id): return {}
@@ -351,7 +351,7 @@ class SliceManager:
         for aggregate in api.aggregates:
             interface = api.aggregates[aggregate]
             server = api.server_proxy(interface, cred)
-            threads.run (_SliverStatus, server, slice_xrn, [cred], options)
+            threads.run (_Status, server, slice_xrn, [cred], options)
         results = [ReturnValue.get_value(result) for result in threads.get_results()]
     
         # get rid of any void result - e.g. when call_id was hit, where by convention we return {}
@@ -365,7 +365,14 @@ class SliceManager:
     
         # mmh, it is expected that all results carry the same urn
         overall['geni_urn'] = results[0]['geni_urn']
-        overall['pl_login'] = results[0]['pl_login']
+        overall['pl_login'] = None
+        for result in results:
+            if result.get('pl_login'):
+                overall['pl_login'] = result['pl_login']
+                break
+            elif isinstance(result.get('value'), dict) and result['value'].get('pl_login'):
+                overall['pl_login'] = result['value']['pl_login']
+                break
         # append all geni_resources
         overall['geni_resources'] = \
             reduce (lambda x,y: x+y, [ result['geni_resources'] for result in results] , [])