[pve-devel] [PATCH zsync 1/6] param_to_job: handle --maxsnap 0 on creation
Fabian Ebner
f.ebner at proxmox.com
Tue May 11 14:59:50 CEST 2021
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 at 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
More information about the pve-devel
mailing list