all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] api: backup: normalize 'dow' format when converting
Date: Wed, 17 Nov 2021 15:21:01 +0100	[thread overview]
Message-ID: <20211117142101.1753771-1-d.csapak@proxmox.com> (raw)

the old web ui sends the days as seperate parameters, which will
be concatenated by a null-byte in the api, causing it to land it this
way in the jobs.cfg

to fix this, split+join the list to get a well-formed dow list

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 PVE/API2/Backup.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/PVE/API2/Backup.pm b/PVE/API2/Backup.pm
index 3b1d5299..c4970bc3 100644
--- a/PVE/API2/Backup.pm
+++ b/PVE/API2/Backup.pm
@@ -52,6 +52,7 @@ my $convert_to_schedule = sub {
 
     my $starttime = $job->{starttime};
     my $dow = $job->{dow};
+    $dow = join(',', PVE::Tools::split_list($dow)) if defined($dow);
 
     if (!$dow || $dow eq ALL_DAYS) {
 	return "$starttime";
-- 
2.30.2





                 reply	other threads:[~2021-11-17 14:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20211117142101.1753771-1-d.csapak@proxmox.com \
    --to=d.csapak@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal