@@ -406,18 +406,16 @@ def _python_action(self) -> int:
406406 return 1
407407
408408 def _local_action (self ) -> int :
409- cmd = self ._build_command (path = self . env . config [ 'import_path' ] )
409+ cmd = self ._build_command ()
410410 try :
411411 return self ._run_local_command (cmd = cmd )
412412 except KeyboardInterrupt :
413413 self .env .LOG .info (KEYBOARD_INTERRUPT_MESSAGE )
414414 return 130
415415
416- def _build_command (self , path : str = '' ) -> str :
416+ def _build_command (self ) -> str :
417417 if self .precommand :
418418 return f'{ self .precommand } ; { self .get_resolved_value ()} '
419- elif self .env .imports :
420- return f'. { path } /' + f'; . { path } /' .join (self .env .imports ) + '; ' + self .get_resolved_value ()
421419 else :
422420 return self .get_resolved_value ()
423421
@@ -458,28 +456,11 @@ def _remote_action_on_hostname(self, hostname: str) -> int:
458456 exitcode = 130
459457 self ._remote_handle_keyboard_interrupt (hostname = hostname )
460458
461- if self .env .imports :
462- self ._remote_cleanup_imports (hostname = hostname )
463-
464459 return exitcode
465460
466461 def _get_remote_command (self , hostname : str ) -> str :
467462 ssh_cmd = self .env .config ["ssh_cmd" ].format (hostname = hostname )
468- remote_cmd = self ._build_command ()
469- prefix = ''
470- if self .env .imports :
471- # How is this working?
472- # - Create a tar archive with all imports
473- # - Pipe it through SSH
474- # - Create tmp dir on remote
475- # - Extract tar archive there
476- # - Source imports in _build_command
477- prefix = f'tar -C { self .env .config ["import_path" ]} -cf - ' + ' ' .join (self .env .imports ) + ' | '
478- remote_cmd = f'mkdir { self .env .config ["remote_tmp_dir" ]} ;' \
479- f' tar -C { self .env .config ["remote_tmp_dir" ]} -xf -;' \
480- f' { self ._build_command (path = self .env .config ["remote_tmp_dir" ])} '
481-
482- return f'{ prefix } { ssh_cmd } { quote ("RUNNING_INSIDE_AUTOMATIX=1 bash -c " + quote (remote_cmd ))} '
463+ return f'{ ssh_cmd } { quote ("RUNNING_INSIDE_AUTOMATIX=1 bash -c " + quote (self ._build_command ()))} '
483464
484465 def _remote_handle_keyboard_interrupt (self , hostname : str ):
485466 ssh_cmd = self .env .config ["ssh_cmd" ].format (hostname = hostname )
@@ -537,19 +518,6 @@ def get_remote_pids(self, hostname) -> list:
537518
538519 return pids
539520
540- def _remote_cleanup_imports (self , hostname : str ):
541- ssh_cmd = self .env .config ["ssh_cmd" ].format (hostname = hostname )
542- cleanup_cmd = f'{ ssh_cmd } rm -r { self .env .config ["remote_tmp_dir" ]} '
543- self .env .LOG .debug (f'Executing: { cleanup_cmd } ' )
544- proc = subprocess .run (cleanup_cmd , shell = True , executable = self .bash_path )
545- if proc .returncode != 0 :
546- self .env .LOG .warning (
547- 'Failed to remove {tmp_dir}, exitcode: {return_code}' .format (
548- tmp_dir = self .env .config ["remote_tmp_dir" ],
549- return_code = proc .returncode ,
550- )
551- )
552-
553521
554522def parse_key (key ) -> tuple [str , ...]:
555523 """
0 commit comments