diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-03-30 22:29:35 -0500 | 
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2025-03-31 00:50:30 -0500 | 
| commit | ab010dbe993afc990fafa4525e1a94670ca7f5a4 (patch) | |
| tree | 610d48220e115555d1770f9d7631999b3101bd80 /src/commit.ml | |
| parent | c7b81cca1e181103d28ec2493aae67818bc14dd1 (diff) | |
| download | vyconf-ab010dbe993afc990fafa4525e1a94670ca7f5a4.tar.gz vyconf-ab010dbe993afc990fafa4525e1a94670ca7f5a4.zip  | |
T7272: call both Lwt connections under a single Lwt.main
Call both the vyconfd server and the vyos-commitd client under the
top-level Lwt.main loop.
Diffstat (limited to 'src/commit.ml')
| -rw-r--r-- | src/commit.ml | 13 | 
1 files changed, 11 insertions, 2 deletions
diff --git a/src/commit.ml b/src/commit.ml index acfecfe..ba740b5 100644 --- a/src/commit.ml +++ b/src/commit.ml @@ -61,6 +61,9 @@ let default_commit_data = {      result = { success = true; out = ""; };  } +let fail_status msg = +    { success=false; out=msg } +  let lex_order c1 c2 =      let c = Vyos1x.Util.lex_order c1.path c2.path in      match c with @@ -222,11 +225,17 @@ let config_result_update c_data n_data =  let commit_update c_data =      match c_data.init with -    | None -> raise (Commit_error "commitd failure: no init status provided") +    | None -> +        { default_commit_data with +          init=Some (fail_status  "commitd failure: no init status provided") +        }      | Some _ ->          let func acc_data nd =              match nd.reply with -            | None -> raise (Commit_error "commitd failure: no reply status provided") +            | None -> +                { default_commit_data with +                  init=Some (fail_status"commitd failure: no reply status provided") +                }              | Some _ -> config_result_update acc_data nd      in List.fold_left func c_data c_data.node_list  | 
