1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-24 21:52:59 +00:00

"kiwi shell" flaws

This commit is contained in:
Jörn-Michael Miehe 2021-12-02 19:04:37 +01:00
parent 4ddad29de0
commit ff8df05708

View file

@ -48,10 +48,11 @@ class ShellCommand(KiwiCommand):
if shell is not None:
shells.appendleft(shell)
shells = list(shells)
user_args = ["-u", user] if user is not None else []
for service in services.content:
existing_shells = service.existing_executables(list(shells))
existing_shells = service.existing_executables(shells)
try:
use_shell = next(existing_shells)
@ -61,8 +62,8 @@ class ShellCommand(KiwiCommand):
if shell is not None:
use_shell = shell
_logger.warning(
"Could not find any working shell in this container. "
f"Launching provided {use_shell!r} nevertheless. This might fail!"
"Could not find a working shell in this container. "
f"Launching provided shell {use_shell!r} nevertheless. This might fail!"
)
else:
@ -70,7 +71,7 @@ class ShellCommand(KiwiCommand):
f"Could not find any working shell among {shells!r} in this container. "
"Please suggest a shell using the '-s SHELL' command line option!"
)
return
continue
# spawn shell
COMPOSE_EXE.run(['exec', *user_args, service.name, use_shell], **project.process_kwargs)