:type guids: list
"""
+ if isinstance(guids, int):
+ guids = [guids]
+
if not guids:
guids = self.resources
self.schedule("0s", rm.release)
self.wait_released(guids)
+
+ for guid in guids:
+ if self.get(guid, "hardRelease"):
+ del self._resources[guid]
def shutdown(self):
""" Releases all resources and stops the ExperimentController
type = Types.Bool,
default = True,
flags = Flags.Design)
+ hard_release = Attribute("hardRelease",
+ "Forces removal of all result files and directories associated "
+ "to the RM upon resource release. After release the RM will "
+ "be removed from the EC and the results will not longer be "
+ "accessible",
+ type = Types.Bool,
+ default = False,
+ flags = Flags.Design)
cls._register_attribute(critical)
+ cls._register_attribute(hard_release)
@classmethod
def _register_traces(cls):
def do_release(self):
self.info("Releasing resource")
+ self.do_stop()
+
tear_down = self.get("tearDown")
if tear_down:
self.node.execute(tear_down)
- self.do_stop()
+ hard_release = self.get("hardRelease")
+ if hard_release:
+ self.node.rmdir(self.app_home)
super(LinuxApplication, self).do_release()