From c508c8c66c76488337745cf151d9570c42e38a3b Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 16 Apr 2025 11:34:43 -0500 Subject: T7363: normalize function naming for auto-generation For auto-generation of Python classes, it is simpler to maintain syntactical consistency; as these operations will be wrapped in any client definitions, verbosity is forgivable. --- src/vyconf_pbt.ml | 16 ++++++++-------- src/vyconf_pbt.mli | 4 ++-- src/vyconfd.ml | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/vyconf_pbt.ml b/src/vyconf_pbt.ml index 5518e27..2f528a1 100644 --- a/src/vyconf_pbt.ml +++ b/src/vyconf_pbt.ml @@ -144,8 +144,8 @@ type request = | List_children of request_list_children | Run_op_mode of request_run_op_mode | Confirm - | Configure of request_enter_configuration_mode - | Exit_configure + | Enter_configuration_mode of request_enter_configuration_mode + | Exit_configuration_mode | Validate of request_validate | Teardown of request_teardown | Reload_reftree of request_reload_reftree @@ -841,8 +841,8 @@ let rec pp_request fmt (v:request) = | List_children x -> Format.fprintf fmt "@[List_children(@,%a)@]" pp_request_list_children x | Run_op_mode x -> Format.fprintf fmt "@[Run_op_mode(@,%a)@]" pp_request_run_op_mode x | Confirm -> Format.fprintf fmt "Confirm" - | Configure x -> Format.fprintf fmt "@[Configure(@,%a)@]" pp_request_enter_configuration_mode x - | Exit_configure -> Format.fprintf fmt "Exit_configure" + | Enter_configuration_mode x -> Format.fprintf fmt "@[Enter_configuration_mode(@,%a)@]" pp_request_enter_configuration_mode x + | Exit_configuration_mode -> Format.fprintf fmt "Exit_configuration_mode" | Validate x -> Format.fprintf fmt "@[Validate(@,%a)@]" pp_request_validate x | Teardown x -> Format.fprintf fmt "@[Teardown(@,%a)@]" pp_request_teardown x | Reload_reftree x -> Format.fprintf fmt "@[Reload_reftree(@,%a)@]" pp_request_reload_reftree x @@ -1210,10 +1210,10 @@ let rec encode_pb_request (v:request) encoder = | Confirm -> Pbrt.Encoder.key 18 Pbrt.Bytes encoder; Pbrt.Encoder.empty_nested encoder - | Configure x -> + | Enter_configuration_mode x -> Pbrt.Encoder.nested encode_pb_request_enter_configuration_mode x encoder; Pbrt.Encoder.key 19 Pbrt.Bytes encoder; - | Exit_configure -> + | Exit_configuration_mode -> Pbrt.Encoder.key 20 Pbrt.Bytes encoder; Pbrt.Encoder.empty_nested encoder | Validate x -> @@ -1906,10 +1906,10 @@ let rec decode_pb_request d = Pbrt.Decoder.empty_nested d ; (Confirm : request) end - | Some (19, _) -> (Configure (decode_pb_request_enter_configuration_mode (Pbrt.Decoder.nested d)) : request) + | Some (19, _) -> (Enter_configuration_mode (decode_pb_request_enter_configuration_mode (Pbrt.Decoder.nested d)) : request) | Some (20, _) -> begin Pbrt.Decoder.empty_nested d ; - (Exit_configure : request) + (Exit_configuration_mode : request) end | Some (21, _) -> (Validate (decode_pb_request_validate (Pbrt.Decoder.nested d)) : request) | Some (22, _) -> (Teardown (decode_pb_request_teardown (Pbrt.Decoder.nested d)) : request) diff --git a/src/vyconf_pbt.mli b/src/vyconf_pbt.mli index 5f768f8..5791bff 100644 --- a/src/vyconf_pbt.mli +++ b/src/vyconf_pbt.mli @@ -151,8 +151,8 @@ type request = | List_children of request_list_children | Run_op_mode of request_run_op_mode | Confirm - | Configure of request_enter_configuration_mode - | Exit_configure + | Enter_configuration_mode of request_enter_configuration_mode + | Exit_configuration_mode | Validate of request_validate | Teardown of request_teardown | Reload_reftree of request_reload_reftree diff --git a/src/vyconfd.ml b/src/vyconfd.ml index bc607a3..9eaee6b 100644 --- a/src/vyconfd.ml +++ b/src/vyconfd.ml @@ -263,8 +263,8 @@ let rec handle_connection world ic oc () = | _, Reload_reftree r -> reload_reftree world r | None, _ -> {response_tmpl with status=Fail; output=(Some "Operation requires session token")} | Some t, Teardown _ -> teardown t - | Some t, Configure r -> enter_conf_mode r t - | Some t, Exit_configure -> exit_conf_mode world t + | Some t, Enter_configuration_mode r -> enter_conf_mode r t + | Some t, Exit_configuration_mode -> exit_conf_mode world t | Some t, Exists r -> exists world t r | Some t, Get_value r -> get_value world t r | Some t, Get_values r -> get_values world t r -- cgit v1.2.3