@@ -744,7 +744,7 @@ pub fn disable_tls_peer_verification_for_all_federation_upstreams(
744744 prog_rep. report_success ( upstream_name) ;
745745 }
746746
747- prog_rep. finish_operation ( total, total ) ;
747+ prog_rep. finish_operation ( total) ;
748748
749749 Ok ( ( ) )
750750}
@@ -825,7 +825,7 @@ pub fn enable_tls_peer_verification_for_all_federation_upstreams(
825825 prog_rep. report_success ( upstream_name) ;
826826 }
827827
828- prog_rep. finish_operation ( total, total ) ;
828+ prog_rep. finish_operation ( total) ;
829829 Ok ( ( ) )
830830}
831831
@@ -849,7 +849,7 @@ pub fn disable_tls_peer_verification_for_all_source_uris(
849849 let owned_params = match OwnedShovelParams :: try_from ( param. clone ( ) ) {
850850 Ok ( params) => params,
851851 Err ( _) => {
852- prog_rep. report_skip ( param_name, "invalid shovel parameters" ) ;
852+ prog_rep. report_skip ( param_name, "shovel parameters fail validation " ) ;
853853 continue ;
854854 }
855855 } ;
@@ -871,51 +871,62 @@ pub fn disable_tls_peer_verification_for_all_source_uris(
871871 prog_rep. report_success ( param_name) ;
872872 }
873873
874- prog_rep. finish_operation ( total, total ) ;
874+ prog_rep. finish_operation ( total) ;
875875
876876 Ok ( ( ) )
877877}
878878
879879pub fn disable_tls_peer_verification_for_all_destination_uris (
880880 client : APIClient ,
881- _prog_rep : & mut dyn ProgressReporter ,
881+ prog_rep : & mut dyn ProgressReporter ,
882882) -> Result < ( ) , CommandRunError > {
883883 let all_params = client. list_runtime_parameters ( ) ?;
884884 let shovel_params: Vec < _ > = all_params
885885 . into_iter ( )
886886 . filter ( |p| p. component == "shovel" )
887887 . collect ( ) ;
888888
889- for param in shovel_params {
889+ let total = shovel_params. len ( ) ;
890+ prog_rep. start_operation ( total, "Updating shovel destination URIs" ) ;
891+
892+ for ( index, param) in shovel_params. into_iter ( ) . enumerate ( ) {
893+ let param_name = & param. name ;
894+ prog_rep. report_progress ( index + 1 , total, param_name) ;
895+
890896 let owned_params = match OwnedShovelParams :: try_from ( param. clone ( ) ) {
891897 Ok ( params) => params,
892- Err ( _) => continue ,
898+ Err ( _) => {
899+ prog_rep. report_skip ( param_name, "shovel parameters fail validation" ) ;
900+ continue ;
901+ }
893902 } ;
894903
895904 let original_destination_uri = & owned_params. destination_uri ;
896905
897906 if original_destination_uri. is_empty ( ) {
907+ prog_rep. report_skip ( param_name, "empty destination URI" ) ;
898908 continue ;
899909 }
900910
901911 let updated_destination_uri = disable_tls_peer_verification ( original_destination_uri) ?;
902912
903- if original_destination_uri != & updated_destination_uri {
904- let mut updated_params = owned_params;
905- updated_params. destination_uri = updated_destination_uri;
913+ let mut updated_params = owned_params;
914+ updated_params. destination_uri = updated_destination_uri;
906915
907- let param = RuntimeParameterDefinition :: from ( & updated_params) ;
908- client. upsert_runtime_parameter ( & param) ?;
909- }
916+ let param = RuntimeParameterDefinition :: from ( & updated_params) ;
917+ client. upsert_runtime_parameter ( & param) ?;
918+ prog_rep . report_success ( param_name ) ;
910919 }
911920
921+ prog_rep. finish_operation ( total) ;
922+
912923 Ok ( ( ) )
913924}
914925
915926pub fn enable_tls_peer_verification_for_all_source_uris (
916927 client : APIClient ,
917928 args : & ArgMatches ,
918- _prog_rep : & mut dyn ProgressReporter ,
929+ prog_rep : & mut dyn ProgressReporter ,
919930) -> Result < ( ) , CommandRunError > {
920931 let ca_cert_path = args
921932 . get_one :: < String > ( "node_local_ca_certificate_bundle_path" )
@@ -939,14 +950,24 @@ pub fn enable_tls_peer_verification_for_all_source_uris(
939950 . filter ( |p| p. component == "shovel" )
940951 . collect ( ) ;
941952
942- for param in shovel_params {
953+ let total = shovel_params. len ( ) ;
954+ prog_rep. start_operation ( total, "Updating shovel source URIs" ) ;
955+
956+ for ( index, param) in shovel_params. into_iter ( ) . enumerate ( ) {
957+ let param_name = & param. name ;
958+ prog_rep. report_progress ( index + 1 , total, param_name) ;
959+
943960 let owned_params = match OwnedShovelParams :: try_from ( param. clone ( ) ) {
944961 Ok ( params) => params,
945- Err ( _) => continue ,
962+ Err ( _) => {
963+ prog_rep. report_skip ( param_name, "shovel parameters fail validation" ) ;
964+ continue ;
965+ }
946966 } ;
947967
948968 let original_source_uri = & owned_params. source_uri ;
949969 if original_source_uri. is_empty ( ) {
970+ prog_rep. report_skip ( param_name, "empty source URI" ) ;
950971 continue ;
951972 }
952973
@@ -957,22 +978,23 @@ pub fn enable_tls_peer_verification_for_all_source_uris(
957978 client_key_path,
958979 ) ?;
959980
960- if original_source_uri != & updated_source_uri {
961- let mut updated_params = owned_params;
962- updated_params. source_uri = updated_source_uri;
981+ let mut updated_params = owned_params;
982+ updated_params. source_uri = updated_source_uri;
963983
964- let param = RuntimeParameterDefinition :: from ( & updated_params) ;
965- client. upsert_runtime_parameter ( & param) ?;
966- }
984+ let param = RuntimeParameterDefinition :: from ( & updated_params) ;
985+ client. upsert_runtime_parameter ( & param) ?;
986+ prog_rep . report_success ( param_name ) ;
967987 }
968988
989+ prog_rep. finish_operation ( total) ;
990+
969991 Ok ( ( ) )
970992}
971993
972994pub fn enable_tls_peer_verification_for_all_destination_uris (
973995 client : APIClient ,
974996 args : & ArgMatches ,
975- _prog_rep : & mut dyn ProgressReporter ,
997+ prog_rep : & mut dyn ProgressReporter ,
976998) -> Result < ( ) , CommandRunError > {
977999 let ca_cert_path = args
9781000 . get_one :: < String > ( "node_local_ca_certificate_bundle_path" )
@@ -996,14 +1018,24 @@ pub fn enable_tls_peer_verification_for_all_destination_uris(
9961018 . filter ( |p| p. component == "shovel" )
9971019 . collect ( ) ;
9981020
999- for param in shovel_params {
1021+ let total = shovel_params. len ( ) ;
1022+ prog_rep. start_operation ( total, "Updating shovel destination URIs" ) ;
1023+
1024+ for ( index, param) in shovel_params. into_iter ( ) . enumerate ( ) {
1025+ let param_name = & param. name ;
1026+ prog_rep. report_progress ( index + 1 , total, param_name) ;
1027+
10001028 let owned_params = match OwnedShovelParams :: try_from ( param. clone ( ) ) {
10011029 Ok ( params) => params,
1002- Err ( _) => continue ,
1030+ Err ( _) => {
1031+ prog_rep. report_skip ( param_name, "shovel parameters fail validation" ) ;
1032+ continue ;
1033+ }
10031034 } ;
10041035
10051036 let original_destination_uri = & owned_params. destination_uri ;
10061037 if original_destination_uri. is_empty ( ) {
1038+ prog_rep. report_skip ( param_name, "empty destination URI" ) ;
10071039 continue ;
10081040 }
10091041
@@ -1014,15 +1046,16 @@ pub fn enable_tls_peer_verification_for_all_destination_uris(
10141046 client_key_path,
10151047 ) ?;
10161048
1017- if original_destination_uri != & updated_destination_uri {
1018- let mut updated_params = owned_params;
1019- updated_params. destination_uri = updated_destination_uri;
1049+ let mut updated_params = owned_params;
1050+ updated_params. destination_uri = updated_destination_uri;
10201051
1021- let param = RuntimeParameterDefinition :: from ( & updated_params) ;
1022- client. upsert_runtime_parameter ( & param) ?;
1023- }
1052+ let param = RuntimeParameterDefinition :: from ( & updated_params) ;
1053+ client. upsert_runtime_parameter ( & param) ?;
1054+ prog_rep . report_success ( param_name ) ;
10241055 }
10251056
1057+ prog_rep. finish_operation ( total) ;
1058+
10261059 Ok ( ( ) )
10271060}
10281061
0 commit comments