diff --git a/shlax/targets/buildah.py b/shlax/targets/buildah.py index 69c68ca..11b74fd 100644 --- a/shlax/targets/buildah.py +++ b/shlax/targets/buildah.py @@ -136,7 +136,7 @@ class Buildah(Localhost): cli.exit_code = await proc.wait() async def clean(self, *args, **kwargs): - if self.mnt: + if self.mnt is not None: await self.exec('buildah', 'umount', self.ctr, buildah=False) - if self.ctr: + if self.ctr is not None: await self.exec('buildah', 'rm', self.ctr, buildah=False) diff --git a/tests/test_proc.py b/tests/test_proc.py index 7ffe2ba..4276263 100644 --- a/tests/test_proc.py +++ b/tests/test_proc.py @@ -29,6 +29,7 @@ test_args_params = [ ('buildah', 'from', 'alpine'), ('buildah', 'mount', ''), ('buildah', 'run', '', '--', 'sh', '-euc', 'echo hi'), + ('buildah', 'umount', ''), ('buildah', 'rm', ''), ] ), @@ -38,6 +39,7 @@ test_args_params = [ ('buildah', 'from', 'alpine'), ('buildah', 'mount', ''), ('buildah', 'run', '--user', 'root', '', '--', 'sh', '-euc', 'echo hi'), + ('buildah', 'umount', ''), ('buildah', 'rm', ''), ] ), @@ -47,6 +49,7 @@ test_args_params = [ ('ssh', 'host', 'buildah', 'from', 'alpine'), ('ssh', 'host', 'buildah', 'mount', ''), ('ssh', 'host', 'buildah', 'run', '--user', 'root', '', '--', 'sh', '-euc', 'echo hi'), + ('ssh', 'host', 'buildah', 'umount', ''), ('ssh', 'host', 'buildah', 'rm', ''), ] ),