X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2Fstart_slice.py;h=78181b3053d1fbeef71f93504d7900dbe35abbab;hb=6ac7c0f051e2fb64f14ba1dab389986165ce812d;hp=4356de2bbe4f4ac64f9ee3d6d84575c51cef1b59;hpb=6691cc4c8f8ca1b6ed0a634c44627e8248db81b9;p=sfa.git diff --git a/sfa/methods/start_slice.py b/sfa/methods/start_slice.py index 4356de2b..78181b30 100644 --- a/sfa/methods/start_slice.py +++ b/sfa/methods/start_slice.py @@ -22,12 +22,19 @@ class start_slice(Method): accepts = [ Parameter(str, "Credential string"), Parameter(str, "Human readable name of slice to instantiate"), + Mixed(Parameter(str, "Request hash"), + Parameter(None, "Request hash not specified")) ] returns = [Parameter(int, "1 if successful")] - def call(self, cred, hrn): - + def call(self, cred, hrn, request_hash=None): + # This cred will be an slice cred, not a user, so we cant use it to + # authenticate the caller's request_hash. Let just get the caller's gid + # from the cred and authenticate using that + client_gid = Credential(string=cred).get_gid_caller() + client_gid_str = client_gid.save_to_string(save_parents=True) + self.api.auth.authenticateGid(client_gid_str, [cred, hrn], request_hash) self.api.auth.check(cred, 'startslice') slices = Slices(self.api) slices.start_slice(hrn)