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 # send the call to the right manager
31 manager_base = 'sfa.managers'
32 mgr_type = self.api.config.SFA_CM_TYPE
33 manager_module = manager_base + ".component_manager_%s" % mgr_type
34 manager = __import__(manager_module, fromlist=[manager_base])