Prevent dev_container arguments from being split

BUG=none
TEST=./tools/dev_container --hermetic bash -c "echo true &&./tools/clippy"

Change-Id: If0bd7b13ae4825e0bdaba9db06e6ec9a80ec3541
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3498847
Reviewed-by: Anton Romanov <romanton@google.com>
Commit-Queue: Anton Romanov <romanton@google.com>
Auto-Submit: Anton Romanov <romanton@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Anton Romanov 2022-03-01 22:09:54 +00:00 committed by Commit Bot
parent ad9e98dbe7
commit 68d1a63014

View file

@ -75,6 +75,8 @@ def main(command: tuple[str, ...], stop: bool = False, hermetic: bool = False):
if not command: if not command:
command = ("/bin/bash",) command = ("/bin/bash",)
command = list(map(quoted, command))
if stop: if stop:
if container_id: if container_id:
print(f"Stopping dev-container {container_id}.") print(f"Stopping dev-container {container_id}.")