the build was failing here due to IndentationError
[sfa.git] / sfa / methods / reboot.py
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 $
3 import os
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
8
9 class reboot(Method):
10     """
11     Reboot the component       
12
13     @param cred credential string specifying the rights of the caller
14     @return None  
15     """
16
17     interfaces = ['component']
18     
19     accepts = [
20         Parameter(str, "Credential string"),
21         ]
22
23     returns = None
24     
25     def call(self, cred):
26         # validate the cred 
27         self.api.auth.check(cred, 'reboot')
28         # send the call to the right manager
29         manager_base = 'sfa.managers'
30         mgr_type = self.api.config.SFA_CM_TYPE
31         manager_module = manager_base + ".component_manager_%s" % mgr_type
32         manager = __import__(manager_module, fromlist=[manager_base])
33         manager.reboot()