[pve-devel] [PATCH v3 manager 09/13] storage_info: avoid duplication

Fabian Ebner f.ebner at proxmox.com
Tue Jun 30 10:24:25 CEST 2020


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/VZDump.pm | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index ce8796d9..9bdb5ab0 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -84,19 +84,18 @@ sub storage_info {
 
     PVE::Storage::activate_storage($cfg, $storage);
 
+    my $info = {
+	scfg => $scfg,
+	maxfiles => $scfg->{maxfiles},
+    };
+
     if ($type eq 'pbs') {
-	return {
-	    scfg => $scfg,
-	    maxfiles => $scfg->{maxfiles},
-	    pbs => 1,
-	};
+	$info->{pbs} = 1;
     } else {
-	return {
-	    scfg => $scfg,
-	    dumpdir => PVE::Storage::get_backup_dir($cfg, $storage),
-	    maxfiles => $scfg->{maxfiles},
-	};
+	$info->{dumpdir} = PVE::Storage::get_backup_dir($cfg, $storage);
     }
+
+    return $info;
 }
 
 sub format_size {
-- 
2.20.1





More information about the pve-devel mailing list