From 4f966d059221005fe1789a4e2bfebebdc20f1563 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 22 May 2020 14:51:41 +0200 Subject: [PATCH] api2/config/remote: use rpcenv for digest for read_remote Signed-off-by: Dominik Csapak --- src/api2/config/remote.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/api2/config/remote.rs b/src/api2/config/remote.rs index 7fc45c41..1bc00fed 100644 --- a/src/api2/config/remote.rs +++ b/src/api2/config/remote.rs @@ -124,11 +124,14 @@ pub fn create_remote(param: Value) -> Result<(), Error> { } )] /// Read remote configuration data. -pub fn read_remote(name: String) -> Result { +pub fn read_remote( + name: String, + _info: &ApiMethod, + mut rpcenv: &mut dyn RpcEnvironment, +) -> Result { let (config, digest) = remote::config()?; let mut data = config.lookup_json("remote", &name)?; - data.as_object_mut().unwrap() - .insert("digest".into(), proxmox::tools::digest_to_hex(&digest).into()); + rpcenv["digest"] = proxmox::tools::digest_to_hex(&digest).into(); Ok(data) }