avoid as much as possible accessing logger through class instances, whenever that...
[sfa.git] / sfa / methods / Describe.py
index 6930f1e..b04b3a6 100644 (file)
@@ -4,6 +4,8 @@ from sfa.util.xrn import urn_to_hrn
 from sfa.util.method import Method
 from sfa.util.sfatablesRuntime import run_sfatables
 from sfa.util.faults import SfaInvalidArgument
+from sfa.util.sfalogging import logger
+
 from sfa.trust.credential import Credential
 
 from sfa.storage.parameter import Parameter, Mixed
@@ -11,10 +13,10 @@ from sfa.storage.parameter import Parameter, Mixed
 
 class Describe(Method):
     """
-    Retrieve a manifest RSpec describing the resources contained by the 
-    named entities, e.g. a single slice or a set of the slivers in a 
-    slice. This listing and description should be sufficiently 
-    descriptive to allow experimenters to use the resources.    
+    Retrieve a manifest RSpec describing the resources contained by the
+    named entities, e.g. a single slice or a set of the slivers in a
+    slice. This listing and description should be sufficiently
+    descriptive to allow experimenters to use the resources.
     @param credential list
     @param options dictionary
     @return dict
@@ -29,8 +31,8 @@ class Describe(Method):
     returns = Parameter(str, "List of resources")
 
     def call(self, urns, creds, options):
-        self.api.logger.info("interface: %s\tmethod-name: %s" %
-                             (self.api.interface, self.name))
+        logger.info("interface: %s\tmethod-name: %s" %
+                    (self.api.interface, self.name))
 
         # client must specify a version
         if not options.get('geni_rspec_version'):
@@ -56,7 +58,7 @@ class Describe(Method):
             chain_name = 'OUTGOING'
         elif self.api.interface in ['slicemgr']:
             chain_name = 'FORWARD-OUTGOING'
-        self.api.logger.debug(
+        logger.debug(
             "ListResources: sfatables on chain %s" % chain_name)
         desc['geni_rspec'] = run_sfatables(
             chain_name, '', origin_hrn, desc['geni_rspec'])