use interface managers
[sfa.git] / sfa / methods / reboot.py
index a5e6f27..4f06296 100644 (file)
@@ -27,4 +27,9 @@ class reboot(Method):
         client_gid_str = client_gid.save_to_string(save_parents=True)
         self.api.auth.authenticateGid(client_gid_str, [cred], request_hash)
         self.api.auth.check(cred, 'reboot')
-        os.system("/sbin/reboot") 
+        # send the call to the right manager
+        manager_base = 'sfa.managers'
+        mgr_type = self.api.config.SFA_CM_TYPE
+        manager_module = manger_base+= ".component_manager_%s" % mgr_type
+        manager = __import__(manager_module, manager_base)
+        manager.reboot()