[pve-devel] [PATCH/RFC manager 5/5] vzdump: make parse error for storage critical

Fabian Ebner f.ebner at proxmox.com
Mon Dec 21 14:48:20 CET 2020


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 at proxmox.com>
---

Needs a dependency bump for the previous patch

 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}};
     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',
-- 
2.20.1






More information about the pve-devel mailing list