Fixed a bug where images and containers would be removed after a successful build

This commit is contained in:
shin- 2013-06-06 09:05:58 -07:00
parent f2bcd532d7
commit a444397b9e
1 changed files with 4 additions and 2 deletions

View File

@ -284,8 +284,10 @@ class BuilderClient(object):
self.logger.addHandler(logging.StreamHandler(self.logs))
def done(self):
self.client.remove_container(*self.tmp_containers)
self.client.remove_image(*self.tmp_images)
if self.image is None:
# The build is unsuccessful, remove temporary containers and images
self.client.remove_container(*self.tmp_containers)
self.client.remove_image(*self.tmp_images)
self.logs.flush()
res = self.logs.getvalue()
#self.logs.close()