X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2FShutdown.py;h=7b086af3c80a285160ad935ab70cc372f8b34207;hb=a78041b7906e53b2d7c5c03bae7256e7035a1e3e;hp=d2880362c7836fecf2daa92a2fe30d90f90fe2d5;hpb=7f9736262f91772fc566b5a54598b22df666729a;p=sfa.git diff --git a/sfa/methods/Shutdown.py b/sfa/methods/Shutdown.py index d2880362..7b086af3 100644 --- a/sfa/methods/Shutdown.py +++ b/sfa/methods/Shutdown.py @@ -2,6 +2,7 @@ from sfa.storage.parameter import Parameter from sfa.trust.credential import Credential from sfa.util.method import Method + class Shutdown(Method): """ Perform an emergency shut down of a sliver. This operation is intended for administrative use. @@ -13,16 +14,17 @@ class Shutdown(Method): interfaces = ['aggregate', 'slicemgr'] accepts = [ Parameter(str, "Slice URN"), - Parameter(type(dict), "Credentials"), - ] + Parameter(type([dict]), "Credentials"), + ] returns = Parameter(bool, "Success or Failure") def call(self, xrn, creds): - valid_creds = self.api.auth.checkCredentials(creds, 'stopslice', xrn) - #log the call - origin_hrn = Credential(string=valid_creds[0]).get_gid_caller().get_hrn() - self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s"%(self.api.interface, origin_hrn, xrn, self.name)) + valid_creds = self.api.auth.checkCredentials(creds, 'stopslice', xrn, + check_sliver_callback=self.api.driver.check_sliver_credentials) + # log the call + origin_hrn = Credential(cred=valid_creds[0]).get_gid_caller().get_hrn() + self.api.logger.info("interface: %s\tcaller-hrn: %s\ttarget-hrn: %s\tmethod-name: %s" % + (self.api.interface, origin_hrn, xrn, self.name)) return self.api.manager.Shutdown(self.api, xrn, creds) -