@@ -115,7 +115,9 @@ def call_rclone_through_script_for_central_connection(
115115 shell = False ,
116116 )
117117
118- if cfg ["connection_method" ] in ["ssh" , "gdrive" , "aws" ]:
118+ if rclone_encryption .connection_method_requires_encryption (
119+ cfg ["connection_method" ]
120+ ):
119121 output = run_function_that_requires_encrypted_rclone_config_access (
120122 cfg , lambda_func
121123 )
@@ -553,7 +555,9 @@ def check_successful_connection_and_raise_error_on_fail(cfg: Configs) -> None:
553555
554556def get_rclone_config_filepath (cfg : Configs ) -> Path :
555557 """Get the path to the central Rclone config for the current `connection_method`."""
556- if cfg ["connection_method" ] in ["aws" , "ssh" , "gdrive" ]:
558+ if rclone_encryption .connection_method_requires_encryption (
559+ cfg ["connection_method" ]
560+ ):
557561 config_filepath = (
558562 cfg .rclone .get_rclone_central_connection_config_filepath ()
559563 )
@@ -656,23 +660,17 @@ def transfer_data(
656660 cfg ,
657661 f"{ rclone_args ('copy' )} "
658662 f'"{ local_filepath } " "{ cfg .rclone .get_rclone_config_name ()} :'
659- f'{ central_filepath } " { extra_arguments } { get_config_arg (cfg )} --ask-password=false' , # TODO: handle the error
663+ f'{ central_filepath } " { extra_arguments } { get_config_arg (cfg )} --ask-password=false' ,
660664 )
661665
662666 elif upload_or_download == "download" :
663667 output = call_rclone_through_script_for_central_connection (
664668 cfg ,
665669 f"{ rclone_args ('copy' )} "
666670 f'"{ cfg .rclone .get_rclone_config_name ()} :'
667- f'{ central_filepath } " "{ local_filepath } " { extra_arguments } { get_config_arg (cfg )} --ask-password=false' , # TODO: handle the error
671+ f'{ central_filepath } " "{ local_filepath } " { extra_arguments } { get_config_arg (cfg )} --ask-password=false' ,
668672 )
669673
670- if (
671- cfg ["connection_method" ] in ["ssh" , "aws" , "gdrive" ]
672- and cfg .rclone .get_rclone_config_encryption_state ()
673- ): # TODO: this is a quick and dirty fix but this MUST be handled better
674- rclone_encryption .remove_credentials_as_password_command ()
675-
676674 # 1) now 'for central connection' terminology is confused, one is for all and the other checks internally if it is aws or not. This is okay but must be consistent
677675 # 2) make a utils function to do the connection method check, this is still kind of weird / error prone
678676
0 commit comments