Minimal cleanup to import managers without Errors. NT.
authorNicolas Turro <Nicolas.Turro@inria.fr>
Tue, 8 Nov 2011 15:55:42 +0000 (16:55 +0100)
committerNicolas Turro <Nicolas.Turro@inria.fr>
Tue, 8 Nov 2011 15:55:42 +0000 (16:55 +0100)
sfa/generic/slab.py
sfa/managers/aggregate_manager_slab.py
sfa/managers/slice_manager_slab.py
sfa/senslab/slabdriver.py

index f68fe41..83e5f6f 100644 (file)
@@ -6,7 +6,7 @@ import sfa.managers.registry_manager_slab
 import sfa.managers.slice_manager_slab
 import sfa.managers.aggregate_manager_slab
 
-class pl (Generic):
+class slab (Generic):
     
     # use the standard api class
     def api_class (self):
@@ -22,7 +22,7 @@ class pl (Generic):
 
     # driver class for server-side services, talk to the whole testbed
     def driver_class (self):
-        return sfa.plc.slabdriver.SlabDriver
+        return sfa.senslab.slabdriver.SlabDriver
 
     # slab does not have a component manager yet
     # manager class
index e45e509..15de0ce 100644 (file)
@@ -10,20 +10,20 @@ from types import StringTypes
 from sfa.util.faults import *
 from sfa.util.xrn import get_authority, hrn_to_urn, urn_to_hrn, Xrn, urn_to_sliver_id
 from sfa.util.plxrn import slicename_to_hrn, hrn_to_pl_slicename, hostname_to_urn
-from sfa.util.rspec import *
-from sfa.util.specdict import *
+#from sfa.util.rspec import *
+#from sfa.util.specdict import *
 from sfa.util.record import SfaRecord
 from sfa.util.policy import Policy
 from sfa.util.record import *
-from sfa.util.sfaticket import SfaTicket
+#from sfa.util.sfaticket import SfaTicket
 
-from sfa.senslab.slices import *
+#from sfa.senslab.slices import *
 
 from sfa.trust.credential import Credential
 import sfa.plc.peers as peers
 from sfa.plc.network import *
 from sfa.senslab.OARrestapi import *
-from sfa.senslab.api import SfaAPI
+#from sfa.senslab.api import SfaAPI
 #from sfa.plc.aggregate import Aggregate
 #from sfa.plc.slices import *
 from sfa.util.version import version_core
index 10eba67..e67d2b5 100644 (file)
@@ -36,16 +36,16 @@ from sfa.trust.credential import Credential
 #import sfa.plc.peers as peers
 from sfa.util.version import version_core
 from sfa.util.callids import Callids
-from sfa.senslab.api import *
+#from sfa.senslab.api import *
 
 
-myapi=SfaAPI(interface='slicemgr')
+#api=SfaAPI(interface='slicemgr')
 
 def _call_id_supported(api, server):
     """
     Returns true if server support the optional call_id arg, false otherwise.
     """
-    server_version = myapi.get_cached_server_version(server)
+    server_version = api.get_cached_server_version(server)
 
     if 'sfa' in server_version:
         code_tag = server_version['code_tag']
@@ -70,8 +70,8 @@ def get_serverproxy_url (server):
 
 def GetVersion(api):
     # peers explicitly in aggregates.xml
-    peers =dict ([ (peername,get_serverproxy_url(v)) for (peername,v) in myapi.aggregates.iteritems()
-                   if peername != myapi.hrn])
+    peers =dict ([ (peername,get_serverproxy_url(v)) for (peername,v) in api.aggregates.iteritems()
+                   if peername != api.hrn])
     version_manager = VersionManager()
     ad_rspec_versions = []
     request_rspec_versions = []
@@ -81,7 +81,7 @@ def GetVersion(api):
         if rspec_version.content_type in ['*', 'request']:
             request_rspec_versions.append(rspec_version.to_dict())
     default_rspec_version = version_manager.get_version("sfa 1").to_dict()
-    xrn=Xrn(myapi.hrn, 'authority+sa')
+    xrn=Xrn(api.hrn, 'authority+sa')
     version_more = {'interface':'slicemgr',
                     'hrn' : xrn.get_hrn(),
                     'urn' : xrn.get_urn(),
@@ -92,9 +92,9 @@ def GetVersion(api):
                     }
     sm_version=version_core(version_more)
     # local aggregate if present needs to have localhost resolved
-    if myapi.hrn in myapi.aggregates:
-        local_am_url=get_serverproxy_url(myapi.aggregates[myapi.hrn])
-        sm_version['peers'][myapi.hrn]=local_am_url.replace('localhost',sm_version['hostname'])
+    if api.hrn in api.aggregates:
+        local_am_url=get_serverproxy_url(api.aggregates[api.hrn])
+        sm_version['peers'][api.hrn]=local_am_url.replace('localhost',sm_version['hostname'])
     return sm_version
 
 
@@ -127,12 +127,12 @@ def drop_slicemgr_stats(api,rspec):
                for node in stats_elements:
                        node.getparent().remove(node)
        except Exception, e:
-               myapi.logger.warn("drop_slicemgr_stats failed: %s " % (str(e)))
+               api.logger.warn("drop_slicemgr_stats failed: %s " % (str(e)))
  
  
  
  
-def CreateSliver(myapi, xrn, creds, rspec_str, users, call_id):
+def CreateSliver(api, xrn, creds, rspec_str, users, call_id):
        
        version_manager = VersionManager()
        def _CreateSliver(aggregate, server, xrn, credential, rspec, users, call_id):
@@ -142,9 +142,9 @@ def CreateSliver(myapi, xrn, creds, rspec_str, users, call_id):
                        # Need to call GetVersion at an aggregate to determine the supported
                        # rspec type/format beofre calling CreateSliver at an Aggregate.
                        print>>sys.stderr, " \r\n SLICE MANAGERSLAB _CreateSliver server " 
-                       server_version = myapi.get_cached_server_version(server)
+                       server_version = api.get_cached_server_version(server)
                        requested_users = users
-                       if 'sfa' not in server_version and 'geni_myapi' in server_version:
+                       if 'sfa' not in server_version and 'geni_api' in server_version:
                                # sfa aggregtes support both sfa and pg rspecs, no need to convert
                                # if aggregate supports sfa rspecs. otherwise convert to pg rspec
                                rspec = RSpec(RSpecConverter.to_pg_rspec(rspec, 'request'))
@@ -153,7 +153,7 @@ def CreateSliver(myapi, xrn, creds, rspec_str, users, call_id):
                                rspec = rspec.toxml()
                                requested_users = sfa_to_pg_users_arg(users)
                        args = [xrn, credential, rspec, requested_users]
-                       if _call_id_supported(myapi, server):
+                       if _call_id_supported(api, server):
                                args.append(call_id)
                        rspec = server.CreateSliver(*args)
                        return {"aggregate": aggregate, "rspec": rspec, "elapsed": time.time()-tStart, "status": "success"}
@@ -172,30 +172,30 @@ def CreateSliver(myapi, xrn, creds, rspec_str, users, call_id):
        if schema:
                rspec.validate(schema)
                
-       print>>sys.stderr, " \r\n \r\n \t\t =======SLICE MANAGER _CreateSliver myapi %s" %(myapi)
+       print>>sys.stderr, " \r\n \r\n \t\t =======SLICE MANAGER _CreateSliver api %s" %(api)
        # if there is a <statistics> section, the aggregates don't care about it,
        # so delete it.
-       drop_slicemgr_stats(myapi,rspec)
+       drop_slicemgr_stats(api,rspec)
        
        # attempt to use delegated credential first
-       credential = myapi.getDelegatedCredential(creds)
+       credential = api.getDelegatedCredential(creds)
        if not credential:
-               credential = myapi.getCredential()
+               credential = api.getCredential()
 
        # get the callers hrn
        hrn, type = urn_to_hrn(xrn)
-       valid_cred = myapi.auth.checkCredentials(creds, 'createsliver', hrn)[0]
+       valid_cred = api.auth.checkCredentials(creds, 'createsliver', hrn)[0]
        caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn()
        threads = ThreadManager()
-       print>>sys.stderr, " \r\n \r\n \t\t =======SLICE MANAGER _CreateSliver myapi aggregates  %s \t caller_hrn %s myapi.hrn %s" %(myapi.aggregates, caller_hrn, myapi.hrn)
-       for aggregate in myapi.aggregates:
+       print>>sys.stderr, " \r\n \r\n \t\t =======SLICE MANAGER _CreateSliver api aggregates  %s \t caller_hrn %s api.hrn %s" %(api.aggregates, caller_hrn, api.hrn)
+       for aggregate in api.aggregates:
        # prevent infinite loop. Dont send request back to caller
        # unless the caller is the aggregate's SM 
-               if caller_hrn == aggregate and aggregate != myapi.hrn:
+               if caller_hrn == aggregate and aggregate != api.hrn:
                        continue
-               interface = myapi.aggregates[aggregate]
-               print>>sys.stderr, " \r\n \r\n \t\t =======SLICE MANAGER _CreateSliver aggregate %s interface %s" %(myapi.aggregates[aggregate],interface)   
-               server = myapi.get_server(interface, credential)
+               interface = api.aggregates[aggregate]
+               print>>sys.stderr, " \r\n \r\n \t\t =======SLICE MANAGER _CreateSliver aggregate %s interface %s" %(api.aggregates[aggregate],interface)   
+               server = api.get_server(interface, credential)
                if server is None:
                        print>>sys.stderr, " \r\n \r\n \t\t =======SLICE MANAGER _CreateSliver NOSERVERS "  
                # Just send entire RSpec to each aggregate
@@ -211,7 +211,7 @@ def CreateSliver(myapi, xrn, creds, rspec_str, users, call_id):
                        try:
                                result_rspec.version.merge(result["rspec"])
                        except:
-                               myapi.logger.log_exc("SM.CreateSliver: Failed to merge aggregate rspec")
+                               api.logger.log_exc("SM.CreateSliver: Failed to merge aggregate rspec")
        return result_rspec.toxml()
         #rspec.merge(result)     
     #return rspec.toxml()
@@ -221,21 +221,21 @@ def RenewSliver(api, xrn, creds, expiration_time, call_id):
 
     (hrn, type) = urn_to_hrn(xrn)
     # get the callers hrn
-    valid_cred = myapi.auth.checkCredentials(creds, 'renewsliver', hrn)[0]
+    valid_cred = api.auth.checkCredentials(creds, 'renewsliver', hrn)[0]
     caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn()
 
     # attempt to use delegated credential first
-    credential = myapi.getDelegatedCredential(creds)
+    credential = api.getDelegatedCredential(creds)
     if not credential:
-        credential = myapi.getCredential()
+        credential = api.getCredential()
     threads = ThreadManager()
-    for aggregate in myapi.aggregates:
+    for aggregate in api.aggregates:
         # prevent infinite loop. Dont send request back to caller
         # unless the caller is the aggregate's SM
-        if caller_hrn == aggregate and aggregate != myapi.hrn:
+        if caller_hrn == aggregate and aggregate != api.hrn:
             continue
 
-        server = myapi.aggregates[aggregate]
+        server = api.aggregates[aggregate]
         threads.run(server.RenewSliver, xrn, [credential], expiration_time, call_id)
     # 'and' the results
     return reduce (lambda x,y: x and y, threads.get_results() , True)
@@ -251,32 +251,32 @@ def get_ticket(api, xrn, creds, rspec, users):
         aggregate_rspecs[aggregate_hrn] = rspec 
 
     # get the callers hrn
-    valid_cred = myapi.auth.checkCredentials(creds, 'getticket', slice_hrn)[0]
+    valid_cred = api.auth.checkCredentials(creds, 'getticket', slice_hrn)[0]
     caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn()
 
     # attempt to use delegated credential first
-    credential = myapi.getDelegatedCredential(creds)
+    credential = api.getDelegatedCredential(creds)
     if not credential:
-        credential = myapi.getCredential() 
+        credential = api.getCredential() 
     threads = ThreadManager()
     for (aggregate, aggregate_rspec) in aggregate_rspecs.iteritems():
         # prevent infinite loop. Dont send request back to caller
         # unless the caller is the aggregate's SM
-        if caller_hrn == aggregate and aggregate != myapi.hrn:
+        if caller_hrn == aggregate and aggregate != api.hrn:
             continue
         server = None
-        if aggregate in myapi.aggregates:
-            server = myapi.aggregates[aggregate]
+        if aggregate in api.aggregates:
+            server = api.aggregates[aggregate]
         else:
             net_urn = hrn_to_urn(aggregate, 'authority')     
             # we may have a peer that knows about this aggregate
-            for agg in myapi.aggregates:
-                target_aggs = myapi.aggregates[agg].get_aggregates(credential, net_urn)
+            for agg in api.aggregates:
+                target_aggs = api.aggregates[agg].get_aggregates(credential, net_urn)
                 if not target_aggs or not 'hrn' in target_aggs[0]:
                     continue
                 # send the request to this address 
                 url = target_aggs[0]['url']
-                server = xmlrpcprotocol.get_server(url, myapi.key_file, myapi.cert_file)
+                server = xmlrpcprotocol.get_server(url, api.key_file, api.cert_file)
                 # aggregate found, no need to keep looping
                 break   
         if server is None:
@@ -306,11 +306,11 @@ def get_ticket(api, xrn, creds, rspec, users):
 
     # create a new ticket
     ticket = SfaTicket(subject = slice_hrn)
-    ticket.set_gid_caller(myapi.auth.client_gid)
-    ticket.set_issuer(key=myapi.key, subject=myapi.hrn)
+    ticket.set_gid_caller(api.auth.client_gid)
+    ticket.set_issuer(key=api.key, subject=api.hrn)
     ticket.set_gid_object(object_gid)
     ticket.set_pubkey(object_gid.get_pubkey())
-    #new_ticket.set_parent(myapi.auth.hierarchy.get_auth_ticket(auth_hrn))
+    #new_ticket.set_parent(api.auth.hierarchy.get_auth_ticket(auth_hrn))
     ticket.set_attributes(attributes)
     ticket.set_rspec(merged_rspec)
     ticket.encode()
@@ -322,20 +322,20 @@ def DeleteSliver(api, xrn, creds, call_id):
     if Callids().already_handled(call_id): return ""
     (hrn, type) = urn_to_hrn(xrn)
     # get the callers hrn
-    valid_cred = myapi.auth.checkCredentials(creds, 'deletesliver', hrn)[0]
+    valid_cred = api.auth.checkCredentials(creds, 'deletesliver', hrn)[0]
     caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn()
 
     # attempt to use delegated credential first
-    credential = myapi.getDelegatedCredential(creds)
+    credential = api.getDelegatedCredential(creds)
     if not credential:
-        credential = myapi.getCredential()
+        credential = api.getCredential()
     threads = ThreadManager()
-    for aggregate in myapi.aggregates:
+    for aggregate in api.aggregates:
         # prevent infinite loop. Dont send request back to caller
         # unless the caller is the aggregate's SM
-        if caller_hrn == aggregate and aggregate != myapi.hrn:
+        if caller_hrn == aggregate and aggregate != api.hrn:
             continue
-        server = myapi.aggregates[aggregate]
+        server = api.aggregates[aggregate]
         threads.run(server.DeleteSliver, xrn, credential, call_id)
     threads.get_results()
     return 1
@@ -344,20 +344,20 @@ def start_slice(api, xrn, creds):
     hrn, type = urn_to_hrn(xrn)
 
     # get the callers hrn
-    valid_cred = myapi.auth.checkCredentials(creds, 'startslice', hrn)[0]
+    valid_cred = api.auth.checkCredentials(creds, 'startslice', hrn)[0]
     caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn()
 
     # attempt to use delegated credential first
-    credential = myapi.getDelegatedCredential(creds)
+    credential = api.getDelegatedCredential(creds)
     if not credential:
-        credential = myapi.getCredential()
+        credential = api.getCredential()
     threads = ThreadManager()
-    for aggregate in myapi.aggregates:
+    for aggregate in api.aggregates:
         # prevent infinite loop. Dont send request back to caller
         # unless the caller is the aggregate's SM
-        if caller_hrn == aggregate and aggregate != myapi.hrn:
+        if caller_hrn == aggregate and aggregate != api.hrn:
             continue
-        server = myapi.aggregates[aggregate]
+        server = api.aggregates[aggregate]
         threads.run(server.Start, xrn, credential)
     threads.get_results()    
     return 1
@@ -366,20 +366,20 @@ def stop_slice(api, xrn, creds):
     hrn, type = urn_to_hrn(xrn)
 
     # get the callers hrn
-    valid_cred = myapi.auth.checkCredentials(creds, 'stopslice', hrn)[0]
+    valid_cred = api.auth.checkCredentials(creds, 'stopslice', hrn)[0]
     caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn()
 
     # attempt to use delegated credential first
-    credential = myapi.getDelegatedCredential(creds)
+    credential = api.getDelegatedCredential(creds)
     if not credential:
-        credential = myapi.getCredential()
+        credential = api.getCredential()
     threads = ThreadManager()
-    for aggregate in myapi.aggregates:
+    for aggregate in api.aggregates:
         # prevent infinite loop. Dont send request back to caller
         # unless the caller is the aggregate's SM
-        if caller_hrn == aggregate and aggregate != myapi.hrn:
+        if caller_hrn == aggregate and aggregate != api.hrn:
             continue
-        server = myapi.aggregates[aggregate]
+        server = api.aggregates[aggregate]
         threads.run(server.Stop, xrn, credential)
     threads.get_results()    
     return 1
@@ -410,27 +410,27 @@ def ListSlices(api, creds, call_id):
     if Callids().already_handled(call_id): return []
 
     # look in cache first
-    if caching and myapi.cache:
-        slices = myapi.cache.get('slices')
+    if caching and api.cache:
+        slices = api.cache.get('slices')
         if slices:
             return slices    
 
     # get the callers hrn
-    valid_cred = myapi.auth.checkCredentials(creds, 'listslices', None)[0]
+    valid_cred = api.auth.checkCredentials(creds, 'listslices', None)[0]
     caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn()
 
     # attempt to use delegated credential first
-    credential = myapi.getDelegatedCredential(creds)
+    credential = api.getDelegatedCredential(creds)
     if not credential:
-        credential = myapi.getCredential()
+        credential = api.getCredential()
     threads = ThreadManager()
     # fetch from aggregates
-    for aggregate in myapi.aggregates:
+    for aggregate in api.aggregates:
         # prevent infinite loop. Dont send request back to caller
         # unless the caller is the aggregate's SM
-        if caller_hrn == aggregate and aggregate != myapi.hrn:
+        if caller_hrn == aggregate and aggregate != api.hrn:
             continue
-        server = myapi.aggregates[aggregate]
+        server = api.aggregates[aggregate]
         threads.run(server.ListSlices, credential, call_id)
 
     # combime results
@@ -440,8 +440,8 @@ def ListSlices(api, creds, call_id):
         slices.extend(result)
     
     # cache the result
-    if caching and myapi.cache:
-        myapi.cache.add('slices', slices)
+    if caching and api.cache:
+        api.cache.add('slices', slices)
 
     return slices
 
@@ -455,7 +455,7 @@ def add_slicemgr_stat(rspec, callname, aggname, elapsed, status):
                        
                etree.SubElement(stats_tag, "aggregate", name=str(aggname), elapsed=str(elapsed), status=str(status))
        except Exception, e:
-               myapi.logger.warn("add_slicemgr_stat failed on  %s: %s" %(aggname, str(e)))
+               api.logger.warn("add_slicemgr_stat failed on  %s: %s" %(aggname, str(e)))
 
 
 
@@ -468,16 +468,16 @@ def ListResources(api, creds, options, call_id):
         args = [credential, my_opts]
         tStart = time.time()
         try:
-            if _call_id_supported(myapi, server):
+            if _call_id_supported(api, server):
                 args.append(call_id)
-            version = myapi.get_cached_server_version(server)
+            version = api.get_cached_server_version(server)
             # force ProtoGENI aggregates to give us a v2 RSpec
             if 'sfa' not in version.keys():
                 my_opts['rspec_version'] = version_manager.get_version('ProtoGENI 2').to_dict()
             rspec = server.ListResources(*args)
             return {"aggregate": aggregate, "rspec": rspec, "elapsed": time.time()-tStart, "status": "success"}
         except Exception, e:
-            myapi.logger.log_exc("ListResources failed at %s" %(server.url))
+            api.logger.log_exc("ListResources failed at %s" %(server.url))
             return {"aggregate": aggregate, "elapsed": time.time()-tStart, "status": "exception"}
 
     if Callids().already_handled(call_id): return ""
@@ -493,29 +493,29 @@ def ListResources(api, creds, options, call_id):
     version_string = "rspec_%s" % (rspec_version.to_string())
 
     # look in cache first
-    if caching and myapi.cache and not xrn:
-        rspec =  myapi.cache.get(version_string)
+    if caching and api.cache and not xrn:
+        rspec =  api.cache.get(version_string)
         if rspec:
             return rspec
 
     # get the callers hrn
-    valid_cred = myapi.auth.checkCredentials(creds, 'listnodes', hrn)[0]
+    valid_cred = api.auth.checkCredentials(creds, 'listnodes', hrn)[0]
     caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn()
 
     # attempt to use delegated credential first
-    cred = myapi.getDelegatedCredential(creds)
+    cred = api.getDelegatedCredential(creds)
     if not cred:
-        cred = myapi.getCredential()
+        cred = api.getCredential()
     threads = ThreadManager()
-    for aggregate in myapi.aggregates:
+    for aggregate in api.aggregates:
         # prevent infinite loop. Dont send request back to caller
         # unless the caller is the aggregate's SM
-        if caller_hrn == aggregate and aggregate != myapi.hrn:
+        if caller_hrn == aggregate and aggregate != api.hrn:
             continue
 
         # get the rspec from the aggregate
-        interface = myapi.aggregates[aggregate]
-        server = myapi.get_server(interface, cred)
+        interface = api.aggregates[aggregate]
+        server = api.get_server(interface, cred)
         threads.run(_ListResources, aggregate, server, [cred], options, call_id)
 
 
@@ -532,16 +532,16 @@ def ListResources(api, creds, options, call_id):
             try:
                 rspec.version.merge(result["rspec"])
             except:
-                myapi.logger.log_exc("SM.ListResources: Failed to merge aggregate rspec")
+                api.logger.log_exc("SM.ListResources: Failed to merge aggregate rspec")
 
     # cache the result
-    if caching and myapi.cache and not xrn:
-        myapi.cache.add(version_string, rspec.toxml())
+    if caching and api.cache and not xrn:
+        api.cache.add(version_string, rspec.toxml())
        
     print >>sys.stderr, "\r\n  slice_manager  \r\n"   , rspec
     return rspec.toxml()
 
-#def ListResources(myapi, creds, options, call_id):
+#def ListResources(api, creds, options, call_id):
 
     #if Callids().already_handled(call_id): return ""
 
@@ -549,8 +549,8 @@ def ListResources(api, creds, options, call_id):
     #xrn = options.get('geni_slice_urn', '')
     #(hrn, type) = urn_to_hrn(xrn)
     #print >>sys.stderr, " SM_ListResources xrn " , xrn
-    ##print >>sys.stderr, " SM ListResources myapi.__dict__ " , myapi.__dict__.keys()
-    ##print >>sys.stderr, " SM ListResources dir(myapi)" , dir(myapi)
+    ##print >>sys.stderr, " SM ListResources api.__dict__ " , api.__dict__.keys()
+    ##print >>sys.stderr, " SM ListResources dir(api)" , dir(api)
     #print >>sys.stderr, "  \r\n avant RspecVersion \r\n \r\n"
     ## get the rspec's return format from options
     #rspec_version = RSpecVersion(options.get('rspec_version'))
@@ -564,31 +564,31 @@ def ListResources(api, creds, options, call_id):
     #print>>sys.stderr,"version string = ",version_string
 
     ## look in cache first
-    #if caching and myapi.cache and not xrn:
-       #print>>sys.stderr," \r\n  caching %s and myapi.cache %s and not xrn %s"%(caching , myapi.cache,xrn) 
-        #rspec =  myapi.cache.get(version_string)
+    #if caching and api.cache and not xrn:
+       #print>>sys.stderr," \r\n  caching %s and api.cache %s and not xrn %s"%(caching , api.cache,xrn) 
+        #rspec =  api.cache.get(version_string)
         #if rspec:
             #return rspec
 
     ## get the callers hrn
     #print >>sys.stderr, " SM ListResources get the callers hrn "
-    #valid_cred = myapi.auth.checkCredentials(creds, 'listnodes', hrn)[0]
+    #valid_cred = api.auth.checkCredentials(creds, 'listnodes', hrn)[0]
     #caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn()
     #print >>sys.stderr, " \r\n SM ListResources get the callers caller_hrn hrn  %s "%(caller_hrn)
     ## attempt to use delegated credential first
-    #credential = myapi.getDelegatedCredential(creds)
+    #credential = api.getDelegatedCredential(creds)
     #print >>sys.stderr, " \r\n SM ListResources get the callers credential  %s "%(credential) 
     #if not credential:
-        #credential = myapi.getCredential()
+        #credential = api.getCredential()
     #threads = ThreadManager()
-    #print >>sys.stderr, " \r\n SM ListResources get the callers myapi.aggregates  %s "%(myapi.aggregates) 
-    #for aggregate in myapi.aggregates:
+    #print >>sys.stderr, " \r\n SM ListResources get the callers api.aggregates  %s "%(api.aggregates) 
+    #for aggregate in api.aggregates:
         ## prevent infinite loop. Dont send request back to caller
         ## unless the caller is the aggregate's SM
-        #if caller_hrn == aggregate and aggregate != myapi.hrn:
+        #if caller_hrn == aggregate and aggregate != api.hrn:
             #continue
         ## get the rspec from the aggregate
-        #server = myapi.aggregates[aggregate]
+        #server = api.aggregates[aggregate]
        #print >>sys.stderr, " Slice Mgr ListResources, server" ,server
         #my_opts = copy(options)
         #my_opts['geni_compressed'] = False
@@ -610,11 +610,11 @@ def ListResources(api, creds, options, call_id):
             #print >>sys.stderr, "AFTERMERGE" , rspec
         #except:
             #raise
-            #myapi.logger.info("SM.ListResources: Failed to merge aggregate rspec")
+            #api.logger.info("SM.ListResources: Failed to merge aggregate rspec")
 
     ## cache the result
-    #if caching and myapi.cache and not xrn:
-        #myapi.cache.add(version_string, rspec.toxml())
+    #if caching and api.cache and not xrn:
+        #api.cache.add(version_string, rspec.toxml())
 
     #print >>sys.stderr, "\r\n  slice_manager  \r\n"   , rspec
     #return rspec.toxml()
@@ -623,12 +623,12 @@ def ListResources(api, creds, options, call_id):
 def SliverStatus(api, slice_xrn, creds, call_id):
     if Callids().already_handled(call_id): return {}
     # attempt to use delegated credential first
-    credential = myapi.getDelegatedCredential(creds)
+    credential = api.getDelegatedCredential(creds)
     if not credential:
-        credential = myapi.getCredential()
+        credential = api.getCredential()
     threads = ThreadManager()
-    for aggregate in myapi.aggregates:
-        server = myapi.aggregates[aggregate]
+    for aggregate in api.aggregates:
+        server = api.aggregates[aggregate]
         threads.run (server.SliverStatus, slice_xrn, credential, call_id)
     results = threads.get_results()
 
index 724f293..40e56be 100644 (file)
@@ -42,7 +42,7 @@ class SlabDriver (OARapi, SenslabImportUsers):
        self.users = self
         self.time_format = "%Y-%m-%d %H:%M:%S"
         #self.logger=sfa_logger()
-       print >>sys.stderr, "\r\n \t\t___________PSFA SENSLAN /API.PY  __init__ STOP ",self.interface #dir(self)
+        #print >>sys.stderr, "\r\n \t\t___________PSFA SENSLAN /API.PY  __init__ STOP ",self.interface #dir(self)
        
     ##
     # Convert SFA fields to PLC fields for use when registering up updating