diff options
| author | John Estabrook <jestabro@vyos.io> | 2025-08-17 13:43:58 -0500 |
|---|---|---|
| committer | John Estabrook <jestabro@vyos.io> | 2025-08-19 09:29:53 -0500 |
| commit | 28efcd85149bb284b7835c360dd2cfeab2f92aa2 (patch) | |
| tree | 969c43e6e3cfd1761f2604d83c020c7c3f4280d5 /src/vyconfd.ml | |
| parent | 88d926d30b4219c50bbb1167ab58d60c5c5d2bbb (diff) | |
| download | vyconf-28efcd85149bb284b7835c360dd2cfeab2f92aa2.tar.gz vyconf-28efcd85149bb284b7835c360dd2cfeab2f92aa2.zip | |
T7728: dynamically generate proposed config from changeset data
Diffstat (limited to 'src/vyconfd.ml')
| -rw-r--r-- | src/vyconfd.ml | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/vyconfd.ml b/src/vyconfd.ml index a0be019..f1b1694 100644 --- a/src/vyconfd.ml +++ b/src/vyconfd.ml @@ -240,9 +240,10 @@ let save world token (req: request_save) = let commit world token (req: request_commit) = let s = find_session token in + let proposed_config = Session.get_proposed_config world s in let req_dry_run = Option.value req.dry_run ~default:false in - let commit_data = Session.prepare_commit ~dry_run:req_dry_run world s token + let commit_data = Session.prepare_commit ~dry_run:req_dry_run world proposed_config token in let%lwt received_commit_data = VC.do_commit commit_data in let%lwt result_commit_data = @@ -263,6 +264,14 @@ let commit world token (req: request_commit) = (* partial commit *) if not req_dry_run then world.Session.running_config <- result_commit_data.config_result; + let session = + { s with changeset = + Session.get_changeset + world + world.Session.running_config + proposed_config } + in Hashtbl.replace sessions token session; + let success, msg_str = result_commit_data.result.success, result_commit_data.result.out in |
