all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dietmar Maurer <dietmar@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	 Thomas Lamprecht <t.lamprecht@proxmox.com>,
	Wolfgang Bumiller <w.bumiller@proxmox.com>
Subject: Re: [pbs-devel] applied: [PATCH proxmox-backup] api2/config/tape_backup_job: fix duplicate id parameter
Date: Wed, 24 Feb 2021 08:28:54 +0100 (CET)	[thread overview]
Message-ID: <747410998.16.1614151735303@webmail.proxmox.com> (raw)
In-Reply-To: <654681787.11.1614147199226@webmail.proxmox.com>

Seems there is another problem with the Updater:

I can delete properties if I use normal rust naming, e.g.

   job.update_from(update, "eject_media")?;

But it does not work with kebab-case:

   job.update_from(update, "eject-media")?; // this fails silently

Please can we:

 - support kebab-case
 - raise error with unknown property names


> On 02/24/2021 7:13 AM Dietmar Maurer <dietmar@proxmox.com> wrote:
> 
>  
> > On 02/23/2021 8:27 PM Dietmar Maurer <dietmar@proxmox.com> wrote:
> > 
> >  
> > Will fix this tomorrow - we need to set the #[fixed] attribute for id
> 
> Just saw that we already set the  #[updater(fixed)] attribute.
> 
> The docs say:
> 
> > Additionally the #[updater(fixed)] option is available to make it illegal 
> > for an updater to modify a field (generating an error if it is set), 
> > while still allowing it to be used to create a new object via the build_from() method.
> 
> So the Updater includes all "fixed" fields (which leads to the duplicate id problem).
> 
> I would prefer an Updater which simply omits fixed fields.
> 
> Can we change that?




  reply	other threads:[~2021-02-24  7:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 14:54 [pbs-devel] " Dominik Csapak
2021-02-23 16:26 ` [pbs-devel] applied: " Dietmar Maurer
2021-02-23 17:00   ` Thomas Lamprecht
2021-02-23 19:27     ` Dietmar Maurer
2021-02-24  6:13       ` Dietmar Maurer
2021-02-24  7:28         ` Dietmar Maurer [this message]
2021-02-24  8:35           ` Wolfgang Bumiller
2021-02-24  8:42             ` Dietmar Maurer
2021-02-24  9:02               ` Wolfgang Bumiller
2021-02-24  9:47                 ` Dietmar Maurer
2021-02-25  8:53                   ` Dietmar Maurer

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=747410998.16.1614151735303@webmail.proxmox.com \
    --to=dietmar@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    --cc=w.bumiller@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