Fix Pod.build to unshare prior to building async

This commit is contained in:
jpic 2020-08-28 18:42:29 +02:00
parent e97e900fc6
commit 7ea6e10282

View File

@ -1,9 +1,11 @@
import cli2 import cli2
import json import json
import os import os
import sys
from shlax.targets.base import Target from shlax.targets.base import Target
from shlax.actions.parallel import Parallel from shlax.actions.parallel import Parallel
from shlax.proc import Proc
from .podman import Podman from .podman import Podman
@ -27,7 +29,7 @@ class Pod:
async def build(self, target, *names): async def build(self, target, *names):
"""Build container images""" """Build container images"""
if not Proc.test or os.getuid() == 0: if not (Proc.test or os.getuid() == 0):
os.execvp('buildah', ['buildah', 'unshare'] + sys.argv) os.execvp('buildah', ['buildah', 'unshare'] + sys.argv)
else: else:
await self._call(target, 'build', *names) await self._call(target, 'build', *names)