Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
fix base_image and image logic
Browse files Browse the repository at this point in the history
  • Loading branch information
reidpr committed Sep 13, 2023
1 parent 6cf3e3c commit 7278fb8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1150,10 +1150,20 @@ def prepare_rollback(self):
# AFAICT the only thing that might be busted is the unpack directories
# for either the base image or the image. We could probably be smarter
# about this, but for now just delete them.
if (hasattr(self, "image")):
try:
base_image = self.base_image
except AttributeError:
base_image = None
try:
image = self.image
except AttributeError:
image = None
if (base_image is not None or image is not None):
ch.INFO("something went wrong, rolling back ...")
bu.cache.unpack_delete(self.base_image, missing_ok=True)
bu.cache.unpack_delete(self.image, missing_ok=True)
if (base_image is not None):
bu.cache.unpack_delete(self.base_image, missing_ok=True)
if (image is not None):
bu.cache.unpack_delete(self.image, missing_ok=True)

def execute(self):
# Everything happens in prepare().
Expand Down

0 comments on commit 7278fb8

Please sign in to comment.