From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Fabian Ebner <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [PATCH/RFC manager 5/5] vzdump: make parse error for storage critical
Date: Mon, 21 Dec 2020 15:56:21 +0100 [thread overview]
Message-ID: <959fcdc7-bdc7-9511-ea7d-6cd2f88e6149@proxmox.com> (raw)
In-Reply-To: <20201221134820.24038-6-f.ebner@proxmox.com>
On 21/12/2020 14:48, Fabian Ebner wrote:
> The actual error is already printed on the CLI and in the task log, so
> there's no real need to make the error message in storage_info() more than
> "parse error\n". It also can/will end up in the mail subject, which is another
> reason to keep it simple.
>
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>
> Needs a dependency bump for the previous patch
that's the sole real reason I'm not applying this just yet, please ping me if
common got bumped and I forget this one.
>
> PVE/VZDump.pm | 1 +
> test/vzdump_new_retention_test.pl | 8 +-------
> 2 files changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
> index d6f9709b..9f486295 100644
> --- a/PVE/VZDump.pm
> +++ b/PVE/VZDump.pm
> @@ -96,6 +96,7 @@ sub storage_info {
> my $storage = shift;
>
> my $cfg = PVE::Storage::config();
> + die "parse error\n" if grep { $_->{section} eq $storage } @{$cfg->{errors}};
I know the errors got out with warn already, but maybe we want to re-print
them here, could be done with a extract-errors helper, which optionally takes
a section and then prints out a "could not parse '$key'" or the like for all
or the errors of that section, respectively - just as an idea...
> my $scfg = PVE::Storage::storage_config($cfg, $storage);
> my $type = $scfg->{type};
>
> diff --git a/test/vzdump_new_retention_test.pl b/test/vzdump_new_retention_test.pl
> index 569419fb..6a2b9170 100755
> --- a/test/vzdump_new_retention_test.pl
> +++ b/test/vzdump_new_retention_test.pl
> @@ -340,7 +340,6 @@ my @tests = (
> remove => 1,
> },
> },
> - # TODO make parse error critical?
> {
> description => 'mixed 2',
> vzdump_param => {
> @@ -349,12 +348,7 @@ my @tests = (
> storage_param => {
> 'prune-backups' => 'keephourly=24',
> },
> - expected => {
> - 'prune-backups' => {
> - 'keep-last' => 7,
> - },
> - remove => 1,
> - },
> + expected => "could not get storage information for 'local': parse error\n",
> },
> {
> description => 'mixed 3',
>
prev parent reply other threads:[~2020-12-21 14:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-21 13:48 [pve-devel] [PATCH-SERIES] small vzdump improvements Fabian Ebner
2020-12-21 13:48 ` [pve-devel] [PATCH manager 1/5] vzdump: defaults: convert to prune-backups early enough Fabian Ebner
2020-12-21 14:33 ` [pve-devel] applied: " Thomas Lamprecht
2020-12-21 13:48 ` [pve-devel] [PATCH manager 2/5] vzdump: sendmail: fix html by closing the tags Fabian Ebner
2020-12-21 14:33 ` [pve-devel] applied: " Thomas Lamprecht
2020-12-21 13:48 ` [pve-devel] [PATCH manager 3/5] vzdump: fix error format for errors coming from storage_info Fabian Ebner
2020-12-21 14:33 ` [pve-devel] applied: " Thomas Lamprecht
2020-12-21 13:48 ` [pve-devel] [PATCH/RFC common 4/5] SectionConfig: parse_config: add errors to result Fabian Ebner
2020-12-21 14:51 ` [pve-devel] applied: " Thomas Lamprecht
2020-12-21 13:48 ` [pve-devel] [PATCH/RFC manager 5/5] vzdump: make parse error for storage critical Fabian Ebner
2020-12-21 14:56 ` 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=959fcdc7-bdc7-9511-ea7d-6cd2f88e6149@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=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