fix: SUDO_USER not used when starting container
This commit is contained in:
parent
f1bf3d7e1d
commit
d1baddc06d
1 changed files with 6 additions and 2 deletions
8
blend
8
blend
|
@ -149,8 +149,12 @@ def core_start_container(name, new_container=False):
|
||||||
subprocess.call(['podman', 'logs', '--since', str(start_time), name])
|
subprocess.call(['podman', 'logs', '--since', str(start_time), name])
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
logproc = pexpect.spawn(
|
if os.environ.get('SUDO_USER') == None:
|
||||||
'podman', args=['logs', '-f', '--since', str(start_time), name], timeout=3600)
|
logproc = pexpect.spawn(
|
||||||
|
'podman', args=['logs', '-f', '--since', str(start_time), name], timeout=3600)
|
||||||
|
else:
|
||||||
|
logproc = pexpect.spawn(
|
||||||
|
'sudo', args=['-u', os.environ.get('SUDO_USER'), 'podman', 'logs', '-f', '--since', str(start_time), name], timeout=3600)
|
||||||
logproc.logfile_read = sys.stdout.buffer
|
logproc.logfile_read = sys.stdout.buffer
|
||||||
|
|
||||||
logproc.expect('Started container.')
|
logproc.expect('Started container.')
|
||||||
|
|
Loading…
Reference in a new issue