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
DeleteSliver supports call_id
[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
cfc2fbb
..
5bb923b
100644
(file)
--- a/
sfa/managers/slice_manager_pl.py
+++ b/
sfa/managers/slice_manager_pl.py
@@
-54,7
+54,7
@@
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, call_id):
+def
CreateSliver
(api, xrn, creds, rspec, users, call_id):
if Callids().already_handled(call_id): return ""
if Callids().already_handled(call_id): return ""
@@
-203,9
+203,9
@@
def get_ticket(api, xrn, creds, rspec, users):
return ticket.save_to_string(save_parents=True)
return ticket.save_to_string(save_parents=True)
-def
delete_slice(api, xrn, creds
):
- hrn, type = urn_to_hrn(xrn)
-
+def
DeleteSliver(api, xrn, creds, call_id
):
+ if Callids().already_handled(call_id): return ""
+ (hrn, type) = urn_to_hrn(xrn)
# get the callers hrn
valid_cred = api.auth.checkCredentials(creds, 'deletesliver', hrn)[0]
caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn()
# get the callers hrn
valid_cred = api.auth.checkCredentials(creds, 'deletesliver', hrn)[0]
caller_hrn = Credential(string=valid_cred).get_gid_caller().get_hrn()
@@
-221,7
+221,7
@@
def delete_slice(api, xrn, creds):
if caller_hrn == aggregate and aggregate != api.hrn:
continue
server = api.aggregates[aggregate]
if caller_hrn == aggregate and aggregate != api.hrn:
continue
server = api.aggregates[aggregate]
- threads.run(server.DeleteSliver, xrn, credential)
+ threads.run(server.DeleteSliver, xrn, credential
, call_id
)
threads.get_results()
return 1
threads.get_results()
return 1
@@
-387,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,'create-slice-tmacktestslice')
+
CreateSliver
(None,'plc.princeton.tmacktestslice',rspec,'create-slice-tmacktestslice')
if __name__ == "__main__":
main()
if __name__ == "__main__":
main()