Added prints for debugging purposes.
authorSandrine Avakian <sandrine.avakian@inria.fr>
Thu, 1 Dec 2011 14:32:19 +0000 (15:32 +0100)
committerSandrine Avakian <sandrine.avakian@inria.fr>
Thu, 1 Dec 2011 14:32:19 +0000 (15:32 +0100)
sfa/methods/ListResources.py
sfa/senslab/OARrestapi.py
sfa/senslab/OARrspec.py
sfa/senslab/slab-import.py
sfa/util/sfatablesRuntime.py

index 6b1e785..522c131 100644 (file)
@@ -1,5 +1,5 @@
 import zlib
-
+import sys
 from sfa.util.xrn import urn_to_hrn
 from sfa.util.method import Method
 from sfa.util.parameter import Parameter, Mixed
@@ -33,8 +33,10 @@ class ListResources(Method):
 
         # get hrn of the original caller 
         origin_hrn = options.get('origin_hrn', None)
+
         if not origin_hrn:
             origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn()
+        print >>sys.stderr, " \r\n \r\n \t Lsitresources.py call :self.api.interface %s  origin_hrn %s options %s \r\n \t creds %s " %(self.api.interface,origin_hrn,options, creds)          
         rspec = self.api.manager.ListResources(self.api, creds, options)
 
         # filter rspec through sfatables 
@@ -42,7 +44,8 @@ class ListResources(Method):
             chain_name = 'OUTGOING'
         elif self.api.interface in ['slicemgr']: 
             chain_name = 'FORWARD-OUTGOING'
-        self.api.logger.debug("ListResources: sfatables on chain %s"%chain_name)
+        self.api.logger.debug("ListResources: sfatables on chain %s"%chain_name)  
+        print >>sys.stderr, " \r\n \r\n \t Listresources.py call : chain_name %s hrn %s origine_hrn %s " %(chain_name, hrn, origin_hrn)
         filtered_rspec = run_sfatables(chain_name, hrn, origin_hrn, rspec) 
  
         if options.has_key('geni_compressed') and options['geni_compressed'] == True:
index 79ec343..0ec528c 100644 (file)
@@ -119,7 +119,7 @@ class OARGETParser:
                tuplelist.append(('boot_state',str(value)))     
        
        def ParseVersion(self) : 
-               print self.raw_json
+               #print self.raw_json
                #print >>sys.stderr, self.raw_json
                if 'oar_version' in self.raw_json :
                        self.version_json_dict.update(api_version=self.raw_json['api_version'] ,
index 2aa8c03..3d50346 100644 (file)
@@ -107,7 +107,7 @@ class OARrspec:
                 #node['tags'] = tags
 
         self.prepared = True 
-        print >>sys.stderr, "\r\n OARrspec  prepare node 10",self.nodes[10]  
+        #print >>sys.stderr, "\r\n OARrspec  prepare node 10",self.nodes[10]  
        #print >>sys.stderr, " \r\n \t\t prepare prepare_nodes \r\n %s " %(self.nodes)
         
     def get_nodes(self):
index ec99668..432c284 100644 (file)
@@ -102,7 +102,7 @@ def import_node(hrn, node):
 
     node_record = table.find({'type': 'node', 'hrn': hrn})
     pkey = Keypair(create=True)        
-    print>>sys.stderr, " \r\n \t slab-import : hrn %s" %(hrn )
+    
     urn = hrn_to_urn(hrn, 'node')
     node_gid = AuthHierarchy.create_gid(urn, create_uuid(), pkey)
     node_record = SfaRecord(hrn=hrn, gid=node_gid, type="node", pointer=node['node_id'])
@@ -184,7 +184,7 @@ def main():
         sys.exit(0)
     root_auth = config.SFA_REGISTRY_ROOT_AUTH
     interface_hrn = config.SFA_INTERFACE_HRN
-    print interface_hrn, root_auth
+
     
     #Get all records in the sfa table   
     # create dict of all existing sfa records
index 2443777..6f3668f 100644 (file)
@@ -1,6 +1,6 @@
 # sfa should not depend on sfatables
 # if the sfatables.runtime import fails, just define run_sfatables as identity
-
+import sys
 try:
     from sfatables.runtime import SFATablesRules
 
@@ -27,9 +27,10 @@ try:
         """
         if not context_callback:
             context_callback = fetch_context
-
+    
         chain = chain.upper()
         rules = SFATablesRules(chain)
+        print>>sys.stderr, " \r\n \r\n \t\t \t sfaTablesRuntime.py run_sfatables context_callback %s  chain %s rules %s " %(context_callback,chain, rules )
         if rules.sorted_rule_list:
             contexts = rules.contexts
             request_context = context_callback(hrn, origin_hrn, contexts)