git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
renamed create_slice into CreateSliver on the managers side
[sfa.git]
/
sfa
/
managers
/
slice_manager_pl.py
diff --git
a/sfa/managers/slice_manager_pl.py
b/sfa/managers/slice_manager_pl.py
index
bc777a6
..
c6531d2
100644
(file)
--- a/
sfa/managers/slice_manager_pl.py
+++ b/
sfa/managers/slice_manager_pl.py
@@
-54,7
+54,10
@@
def GetVersion(api):
sm_version['peers'][api.hrn]=local_am_url.replace('localhost',sm_version['hostname'])
return sm_version
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
hrn, type = urn_to_hrn(xrn)
# Validate the RSpec against PlanetLab's schema --disabled for now
@@
-93,7
+96,7
@@
def create_slice(api, xrn, creds, rspec, users):
# Just send entire RSpec to each aggregate
server = api.aggregates[aggregate]
# 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)
results = threads.get_results()
merged_rspec = merge_rspecs(results)
@@
-325,10
+328,11
@@
def get_slices(api, creds):
# Thierry : caching at the slicemgr level makes sense to some extent
caching=True
# 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_i
d(call_id):
- api.logger.info("%d received
get_rspec
with known call_id %s"%(api.interface,call_id))
+ if
Callids().already_handle
d(call_id):
+ api.logger.info("%d received
ListResources
with known call_id %s"%(api.interface,call_id))
return ""
# get slice's hrn from options
return ""
# get slice's hrn from options
@@
-383,7
+387,7
@@
def main():
r = RSpec()
r.parseFile(sys.argv[1])
rspec = r.toDict()
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()
if __name__ == "__main__":
main()