mirror of
https://github.com/yavook/kiwi-scp.git
synced 2024-11-21 20:33:00 +00:00
"kiwi shell" flaws
This commit is contained in:
parent
4ddad29de0
commit
ff8df05708
1 changed files with 5 additions and 4 deletions
|
@ -48,10 +48,11 @@ class ShellCommand(KiwiCommand):
|
||||||
if shell is not None:
|
if shell is not None:
|
||||||
shells.appendleft(shell)
|
shells.appendleft(shell)
|
||||||
|
|
||||||
|
shells = list(shells)
|
||||||
user_args = ["-u", user] if user is not None else []
|
user_args = ["-u", user] if user is not None else []
|
||||||
|
|
||||||
for service in services.content:
|
for service in services.content:
|
||||||
existing_shells = service.existing_executables(list(shells))
|
existing_shells = service.existing_executables(shells)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
use_shell = next(existing_shells)
|
use_shell = next(existing_shells)
|
||||||
|
@ -61,8 +62,8 @@ class ShellCommand(KiwiCommand):
|
||||||
if shell is not None:
|
if shell is not None:
|
||||||
use_shell = shell
|
use_shell = shell
|
||||||
_logger.warning(
|
_logger.warning(
|
||||||
"Could not find any working shell in this container. "
|
"Could not find a working shell in this container. "
|
||||||
f"Launching provided {use_shell!r} nevertheless. This might fail!"
|
f"Launching provided shell {use_shell!r} nevertheless. This might fail!"
|
||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -70,7 +71,7 @@ class ShellCommand(KiwiCommand):
|
||||||
f"Could not find any working shell among {shells!r} in this container. "
|
f"Could not find any working shell among {shells!r} in this container. "
|
||||||
"Please suggest a shell using the '-s SHELL' command line option!"
|
"Please suggest a shell using the '-s SHELL' command line option!"
|
||||||
)
|
)
|
||||||
return
|
continue
|
||||||
|
|
||||||
# spawn shell
|
# spawn shell
|
||||||
COMPOSE_EXE.run(['exec', *user_args, service.name, use_shell], **project.process_kwargs)
|
COMPOSE_EXE.run(['exec', *user_args, service.name, use_shell], **project.process_kwargs)
|
||||||
|
|
Loading…
Reference in a new issue