]> git.proxmox.com Git - proxmox-backup.git/commitdiff
api2/config/remote: use rpcenv for digest for read_remote
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 22 May 2020 12:51:41 +0000 (14:51 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 26 May 2020 06:48:28 +0000 (08:48 +0200)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/api2/config/remote.rs

index 7fc45c41432fdeec14a2b527426b8b8f0fe16e32..1bc00fedc70bf2a19d48d576be64139b6e703462 100644 (file)
@@ -124,11 +124,14 @@ pub fn create_remote(param: Value) -> Result<(), Error> {
     }
 )]
 /// Read remote configuration data.
-pub fn read_remote(name: String) -> Result<Value, Error> {
+pub fn read_remote(
+    name: String,
+    _info: &ApiMethod,
+    mut rpcenv: &mut dyn RpcEnvironment,
+) -> Result<Value, Error> {
     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)
 }