X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmethods%2FShutdown.py;h=60e2dd34981c485ee099b71ec0483ab6a3d996ed;hb=f5f5269fbbb8d3eb2bde937355604ebac5a8a197;hp=cd36532dc2260162c21b7e30666e1cc908609c06;hpb=ab1db6daf8727d5c48789b1677662a0f3d96fd24;p=sfa.git diff --git a/sfa/methods/Shutdown.py b/sfa/methods/Shutdown.py index cd36532d..60e2dd34 100644 --- a/sfa/methods/Shutdown.py +++ b/sfa/methods/Shutdown.py @@ -2,9 +2,9 @@ from sfa.util.faults import * from sfa.util.namespace import * from sfa.util.method import Method from sfa.util.parameter import Parameter +from sfa.methods.Stop import Stop - -class Shutdown(Method): +class Shutdown(Stop): """ Perform an emergency shut down of a sliver. This operation is intended for administrative use. The sliver is shut down but remains available for further forensics. @@ -12,7 +12,7 @@ class Shutdown(Method): @param slice_urn (string) URN of slice to renew @param credentials ([string]) of credentials """ - interfaces = ['geni_am'] + interfaces = ['aggregate', 'slicemgr', 'geni_am'] accepts = [ Parameter(str, "Slice URN"), Parameter(type([str]), "List of credentials"), @@ -20,20 +20,6 @@ class Shutdown(Method): returns = Parameter(bool, "Success or Failure") def call(self, slice_xrn, creds): - hrn, type = urn_to_hrn(slice_xrn) - - self.api.logger.info("interface: %s\ttarget-hrn: %s\tcaller-creds: %s\tmethod-name: %s"%(self.api.interface, hrn, creds, self.name)) - - # Find the valid credentials - ValidCreds = self.api.auth.checkCredentials(creds, 'shutdown', hrn) - - manager_base = 'sfa.managers' - - if self.api.interface in ['geni_am']: - mgr_type = self.api.config.SFA_GENI_AGGREGATE_TYPE - manager_module = manager_base + ".geni_am_%s" % mgr_type - manager = __import__(manager_module, fromlist=[manager_base]) - return manager.Shutdown(self.api, slice_xrn, ValidCreds) - return '' + return Stop.call(self, slice_xrn, creds)