示例#1
0
    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)
示例#2
0
    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)
示例#3
0
 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)
示例#4
0
 def tearDown(self):
     if self.basePath:
         Shell.nukeDirectory(self.basePath).catch(TestCore.raiser)
     if self.projectsPath:
         Shell.nukeDirectory(self.projectsPath).catch(TestCore.raiser)
示例#5
0
 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())
     ])