def tearDownClass(cls): if cls.engine and cls.engine.isProvisioned(): cls.engine.deprovision() if cls.basePath: Shell.nukeDirectory(cls.basePath).catch(cls.raiser) if cls.projectsPath: Shell.nukeDirectory(cls.projectsPath).catch(cls.raiser)
def tearDownClass(cls): if cls.vmUUID: machine.terminate(cls.vmUUID) machine.delete(cls.vmUUID) if cls.basePath: Shell.nukeDirectory(cls.basePath).catch(cls.raiser) if cls.projectsPath: Shell.nukeDirectory(cls.projectsPath).catch(cls.raiser)
def remove(self): if not os.path.isdir(self.enginePath): return Fail( FileSystemError("Engine \"%s\" does not exist." % self.name)) if self.isProvisioned(): return Fail( EngineProvisioned("Engine \"%s\" is provisioned." % self.name)) return Shell.nukeDirectory(self.enginePath)
def tearDown(self): if self.basePath: Shell.nukeDirectory(self.basePath).catch(TestCore.raiser) if self.projectsPath: Shell.nukeDirectory(self.projectsPath).catch(TestCore.raiser)
def delete(self): logger.info("Removing box %s from box cache", self.getShortBoxString()) return Try.sequence([ self.core.getDB().removeBoxRecord(self), Shell.nukeDirectory(self.getPath()) ])