-### $Id: start_slice.py 15428 2009-10-23 15:28:03Z tmack $
-### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfa/methods/start_slice.py $
+### $Id: reset_slice.py 15428 2009-10-23 15:28:03Z tmack $
+### $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfacomponent/methods/reset_slice.py $
from sfa.util.faults import *
from sfa.util.misc import *
class reset_slice(Method):
"""
- Start the specified slice
+ Reset the specified slice
@param cred credential string specifying the rights of the caller
@param hrn human readable name of slice to instantiate
client_gid = Credential(string=cred).get_gid_caller()
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, 'startslice')
+ self.api.auth.check(cred, 'resetslice')
+ slicename = hrn_to_pl_slicename(hrn)
+ if not self.api.sliver_exists(slicename):
+ raise SliverDoesNotExist(slicename)
- if not self.api.sliver_exists(hrn):
- raise SliverDoesNotExist(hrn)
-
- self.api.nodemanager.ReCreate(hrn)
+ self.api.nodemanager.ReCreate(slicename)
return 1