sm_version['peers'][api.hrn]=local_am_url.replace('localhost',sm_version['hostname'])
return sm_version
-def create_slice(api, xrn, creds, rspec, users):
+def CreateSliver(api, xrn, creds, rspec, users, call_id):
+
+ if Callids().already_handled(call_id): return ""
+
hrn, type = urn_to_hrn(xrn)
# Validate the RSpec against PlanetLab's schema --disabled for now
# Just send entire RSpec to each aggregate
server = api.aggregates[aggregate]
- threads.run(server.CreateSliver, xrn, credential, rspec, users)
+ threads.run(server.CreateSliver, xrn, credential, rspec, users, call_id)
results = threads.get_results()
merged_rspec = merge_rspecs(results)
# Thierry : caching at the slicemgr level makes sense to some extent
caching=True
-def get_rspec(api, creds, options, call_id):
+#caching=False
+def ListResources(api, creds, options, call_id):
- if not Callids().should_handle_call_id(call_id):
- api.logger.info("%d received get_rspec with known call_id %s"%(api.interface,call_id))
+ if Callids().already_handled(call_id):
+ api.logger.info("%d received ListResources with known call_id %s"%(api.interface,call_id))
return ""
# get slice's hrn from options
r = RSpec()
r.parseFile(sys.argv[1])
rspec = r.toDict()
- create_slice(None,'plc.princeton.tmacktestslice',rspec)
+ CreateSliver(None,'plc.princeton.tmacktestslice',rspec,'create-slice-tmacktestslice')
if __name__ == "__main__":
main()