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
avoid publishing non-relevant entries in GetVersion
[sfa.git]
/
sfa
/
methods
/
Shutdown.py
diff --git
a/sfa/methods/Shutdown.py
b/sfa/methods/Shutdown.py
index
e97738c
..
7b086af
100644
(file)
--- 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
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.
class Shutdown(Method):
"""
Perform an emergency shut down of a sliver. This operation is intended for administrative use.
@@
-14,15
+15,16
@@
class Shutdown(Method):
accepts = [
Parameter(str, "Slice URN"),
Parameter(type([dict]), "Credentials"),
accepts = [
Parameter(str, "Slice URN"),
Parameter(type([dict]), "Credentials"),
-
]
+ ]
returns = Parameter(bool, "Success or Failure")
def call(self, xrn, creds):
returns = Parameter(bool, "Success or Failure")
def call(self, xrn, creds):
- valid_creds = self.api.auth.checkCredentials(creds, 'stopslice', xrn)
- #log the call
+ 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()
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))
+ 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)
return self.api.manager.Shutdown(self.api, xrn, creds)
-