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
# 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
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:
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'] ,
#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):
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'])
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
# 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
"""
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)