File tree Expand file tree Collapse file tree 3 files changed +4
-13
lines changed Expand file tree Collapse file tree 3 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ def submit_job(args: Namespace) -> None:
126126 if args .time is not None :
127127 cmd += f' --time { args .time } '
128128
129- return_code = run_command_with_full_controls (cmd , 'run task' , args )
129+ return_code = run_command_with_full_controls (cmd , 'run task' )
130130
131131 if return_code != 0 :
132132 xpk_print (f'Running task returned ERROR { return_code } ' )
Original file line number Diff line number Diff line change @@ -38,9 +38,7 @@ def shell(args: Namespace):
3838 if exisitng_shell_pod_name is None :
3939 return_code = connect_to_new_interactive_shell (args )
4040 else :
41- return_code = connect_to_existing_interactive_shell (
42- exisitng_shell_pod_name , args
43- )
41+ return_code = connect_to_existing_interactive_shell (exisitng_shell_pod_name )
4442
4543 if return_code != 0 :
4644 xpk_print (f'The command failed with code { return_code } .' )
@@ -94,21 +92,17 @@ def connect_to_new_interactive_shell(args: Namespace) -> int:
9492 return run_command_with_full_controls (
9593 command = cmd ,
9694 task = 'Creating new interactive shell and entering it' ,
97- global_args = args ,
9895 instructions = exit_instructions ,
9996 )
10097
10198
102- def connect_to_existing_interactive_shell (
103- pod_name : str , args : Namespace
104- ) -> int :
99+ def connect_to_existing_interactive_shell (pod_name : str ) -> int :
105100 return run_command_with_full_controls (
106101 command = (
107102 f'kubectl exec --stdin --tty { pod_name } --'
108103 f' { get_pod_template_interactive_command ()} '
109104 ),
110105 task = 'Entering existing interactive shell' ,
111- global_args = args ,
112106 instructions = exit_instructions ,
113107 )
114108
Original file line number Diff line number Diff line change 1818import subprocess
1919import sys
2020import time
21- from argparse import Namespace
2221
2322from ..utils .objects import chunks
2423from ..utils .file import make_tmp_files , write_tmp_file
@@ -301,7 +300,6 @@ def run_command_for_value(
301300def run_command_with_full_controls (
302301 command : str ,
303302 task : str ,
304- global_args : Namespace ,
305303 instructions : str | None = None ,
306304) -> int :
307305 """Run command in current shell with system out, in and error handles. Wait
@@ -310,13 +308,12 @@ def run_command_with_full_controls(
310308 Args:
311309 command: command to execute
312310 task: user-facing name of the task
313- global_args: user provided arguments for running the command.
314311 verbose: shows stdout and stderr if set to true. Set to True by default.
315312
316313 Returns:
317314 0 if successful and 1 otherwise.
318315 """
319- if global_args . dry_run :
316+ if is_dry_run () :
320317 xpk_print (
321318 f'Task: `{ task } ` is implemented by the following command'
322319 ' not running since it is a dry run.'
You can’t perform that action at this time.
0 commit comments