Pass status directly to clean
This commit is contained in:
parent
9c3790e438
commit
1660acbcbb
@ -66,13 +66,12 @@ class Target:
|
|||||||
self.output.success(action)
|
self.output.success(action)
|
||||||
result.status = 'success'
|
result.status = 'success'
|
||||||
finally:
|
finally:
|
||||||
action.result = result
|
|
||||||
self.caller.results.append(result)
|
self.caller.results.append(result)
|
||||||
|
|
||||||
clean = getattr(action, 'clean', None)
|
clean = getattr(action, 'clean', None)
|
||||||
if clean:
|
if clean:
|
||||||
self.output.clean(action)
|
self.output.clean(action)
|
||||||
await clean(self)
|
await clean(self, result)
|
||||||
|
|
||||||
async def rexec(self, *args, **kwargs):
|
async def rexec(self, *args, **kwargs):
|
||||||
kwargs['user'] = 'root'
|
kwargs['user'] = 'root'
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class Buildah(Target):
|
|||||||
self.image_previous = action_image
|
self.image_previous = action_image
|
||||||
return stop
|
return stop
|
||||||
|
|
||||||
async def clean(self, target):
|
async def clean(self, target, result):
|
||||||
for src, dst in self.mounts.items():
|
for src, dst in self.mounts.items():
|
||||||
await self.parent.exec('umount', self.root / str(dst)[1:])
|
await self.parent.exec('umount', self.root / str(dst)[1:])
|
||||||
|
|
||||||
@ -147,12 +147,12 @@ class Buildah(Target):
|
|||||||
await self.parent.exec('buildah', 'umount', self.ctr)
|
await self.parent.exec('buildah', 'umount', self.ctr)
|
||||||
|
|
||||||
if self.ctr is not None:
|
if self.ctr is not None:
|
||||||
if self.result.status == 'success':
|
if result.status == 'success':
|
||||||
await self.commit()
|
await self.commit()
|
||||||
|
|
||||||
await self.parent.exec('buildah', 'rm', self.ctr)
|
await self.parent.exec('buildah', 'rm', self.ctr)
|
||||||
|
|
||||||
if self.result.status == 'success' and os.getenv('BUILDAH_PUSH'):
|
if result.status == 'success' and os.getenv('BUILDAH_PUSH'):
|
||||||
await self.image.push(target)
|
await self.image.push(target)
|
||||||
|
|
||||||
async def mount(self, src, dst):
|
async def mount(self, src, dst):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user