1 ### $Id: reboot.py 15428 2009-10-23 15:28:03Z tmack $
2 ### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfacomponent/methods/reboot.py $
4 from sfa.util.faults import *
5 from sfa.util.misc import *
6 from sfa.util.method import Method
7 from sfa.util.parameter import Parameter, Mixed
13 @param cred credential string specifying the rights of the caller
17 interfaces = ['component']
20 Parameter(str, "Credential string"),
25 def call(self, cred, request_hash=None):
26 client_gid = Credential(string=cred).get_gid_caller()
27 client_gid_str = client_gid.save_to_string(save_parents=True)
28 self.api.auth.authenticateGid(client_gid_str, [cred], request_hash)
29 self.api.auth.check(cred, 'reboot')
30 os.system("/sbin/reboot")