public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Philipp Hufnagl <p.hufnagl@proxmox.com>
Subject: [pbs-devel] applied: [PATCH proxmox-backup v3] fix #4971: client: Improve output on successful snapshot deletion
Date: Wed, 18 Oct 2023 11:06:58 +0200	[thread overview]
Message-ID: <8731220d-ca80-49b2-ad13-b8e047a0d3cc@proxmox.com> (raw)
In-Reply-To: <20231016114015.1263808-1-p.hufnagl@proxmox.com>

Am 16/10/2023 um 13:40 schrieb Philipp Hufnagl:
> When a snapshot gets deleted (forgotten), the proxmox backup client
> currently returns returns
> "Result: {
>   "data": null
> }"
> 
> This feedback may confuse users therefore this patch removes the output.
> 
> Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
> ---
> 
> Changes since v1
> * Remove output message
> 
> Changes since v2
> * Change commit message
> 
>  proxmox-backup-client/src/snapshot.rs | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)


applied, with a small follow-up (see below), thanks!

> 
> diff --git a/proxmox-backup-client/src/snapshot.rs b/proxmox-backup-client/src/snapshot.rs
> index 4ca8015f..fcfe5840 100644
> --- a/proxmox-backup-client/src/snapshot.rs
> +++ b/proxmox-backup-client/src/snapshot.rs
> @@ -188,13 +188,13 @@ async fn forget_snapshots(param: Value) -> Result<Value, Error> {
>  
>      let path = format!("api2/json/admin/datastore/{}/snapshots", repo.store());
>  
> -    let result = client
> +    client
>          .delete(&path, Some(snapshot_args(&backup_ns, &snapshot)?))
>          .await?;
>  
>      record_repository(&repo);
>  
> -    Ok(result)
> +    Ok(Value::Null)

One small thing, sorry to not have caught this earlier, but as we no
never return a serde_json::Value, it'd a bit cleaner to return an empty
tuple here via `Ok(())` and change the functions' signature
respectively.

I fixed that in a follow-up, IMO it was to small of a change to warrant
a v4 here.




      reply	other threads:[~2023-10-18  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 11:40 [pbs-devel] " Philipp Hufnagl
2023-10-18  9:06 ` Thomas Lamprecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8731220d-ca80-49b2-ad13-b8e047a0d3cc@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=p.hufnagl@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal