public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH zsync 1/6] param_to_job: handle --maxsnap 0 on creation
Date: Tue, 11 May 2021 14:59:50 +0200	[thread overview]
Message-ID: <20210511125955.25105-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210511125955.25105-1-f.ebner@proxmox.com>

format_job expects the value to be set, so creating a job with '--maxsnap 0' led
to '--maxsnap' being written without an argument, and thus a (for zsync)
unparsable cron file.

However, issuing sync jobs via CLI with '--maxsnap 0' works with 0 being treated
as unlimited. There is a default value, so no need to worry about definedness,
simply pass along the value.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
 pve-zsync | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pve-zsync b/pve-zsync
index 82e85bc..088b7f2 100755
--- a/pve-zsync
+++ b/pve-zsync
@@ -335,7 +335,7 @@ sub param_to_job {
     $job->{method} = "local" if !$dest->{ip} && !$source->{ip};
     $job->{method} = "ssh" if !$job->{method};
     $job->{limit} = $param->{limit};
-    $job->{maxsnap} = $param->{maxsnap} if $param->{maxsnap};
+    $job->{maxsnap} = $param->{maxsnap};
     $job->{source} = $param->{source};
     $job->{source_user} = $param->{source_user};
     $job->{dest_user} = $param->{dest_user};
-- 
2.20.1





  reply	other threads:[~2021-05-11 13:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 12:59 [pve-devel] [PATCH-SERIES zsync] fix #3351: allow keeping a different number of snapshots on source and destination Fabian Ebner
2021-05-11 12:59 ` Fabian Ebner [this message]
2021-05-11 12:59 ` [pve-devel] [PATCH zsync 2/6] usage: improve maxsnap description Fabian Ebner
2021-05-11 12:59 ` [pve-devel] [PATCH zsync 3/6] remove all old snapshots belonging to a job Fabian Ebner
2021-05-11 12:59 ` [pve-devel] [PATCH zsync 4/6] snapshot_get: make interface agnostic to source/dest Fabian Ebner
2021-05-11 12:59 ` [pve-devel] [PATCH zsync 5/6] snapshot_destroy: " Fabian Ebner
2021-05-11 12:59 ` [pve-devel] [PATCH zsync 6/6] fix #3351: allow keeping a different number of snapshots on source and destination Fabian Ebner
2021-05-24 16:00   ` Bruce Wainer
2021-05-25  5:10     ` Thomas Lamprecht
2021-05-25 12:02 ` [pve-devel] applied-series: [PATCH-SERIES zsync] " Thomas Lamprecht

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=20210511125955.25105-2-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-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