From 157b5e90d109aaeb84cbb16d0c7003fa10a7f42b Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Tue, 1 Dec 2009 20:25:31 +0000 Subject: [PATCH] use interface managers --- sfa/methods/reboot.py | 7 ++++++- sfa/methods/reset_slice.py | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/sfa/methods/reboot.py b/sfa/methods/reboot.py index a5e6f27a..4f062969 100644 --- a/sfa/methods/reboot.py +++ b/sfa/methods/reboot.py @@ -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() diff --git a/sfa/methods/reset_slice.py b/sfa/methods/reset_slice.py index 19cec35d..1bb8b054 100644 --- a/sfa/methods/reset_slice.py +++ b/sfa/methods/reset_slice.py @@ -36,6 +36,22 @@ class reset_slice(Method): client_gid_str = client_gid.save_to_string(save_parents=True) self.api.auth.authenticateGid(client_gid_str, [cred, hrn], request_hash) self.api.auth.check(cred, 'resetslice') - ## XX Not yet implemented - + # send the call to the right manager + manager_base = 'sfa.managers' + if self.api.interface in ['component']: + mgr_type = self.api.config.SFA_CM_TYPE + manager_module = manger_base+= ".component_manager_%s" % mgr_type + manager = __import__(manager_module, manager_base) + manager.reset_slice(self.api, hrn) + elif self.api.interface in ['aggregate']: + mgr_type = self.api.config.SFA_AGGREGATE_TYPE + manager_module = manger_base+= ".agregate_manager_%s" % mgr_type + manager = __import__(manager_module, manager_base) + manager.reset_slice(self.api, hrn) + elif self.api.interface in ['slicemngr']: + mgr_type = self.api.config.SFA_SM_TYPE + manager_module = manger_base+= ".slice_manager_%s" % mgr_type + manager = __import__(manager_module, manager_base) + manager.reset_slice(self.api, hrn) + return 1 -- 2.43.0