From ab0640b3f0333dca4c5c6cc2023bdb4ced396c82 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Thu, 6 Mar 2025 12:01:51 +0100 Subject: [PATCH] Add way to return ShellCommand parameters as list This is useful if command is going to be run in the POD as arguments for the POD's command should be passed to the OpenShift client as list of attributes rather then string. Related: #TOBIKO-131 Change-Id: I9da5bfb8b0f98ed86c4dff54039392537b8286bf --- tobiko/shell/sh/_command.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tobiko/shell/sh/_command.py b/tobiko/shell/sh/_command.py index 955ff8498..ac762365c 100644 --- a/tobiko/shell/sh/_command.py +++ b/tobiko/shell/sh/_command.py @@ -37,6 +37,9 @@ class ShellCommand(tuple): def __contains__(self, item) -> bool: return item in str(self) + def as_list(self): + return str(self).split(" ") + def shell_command(command: ShellCommandType, **shlex_params) -> ShellCommand: