[pve-devel] [PATCH v2 manager 09/13] storage_info: avoid duplication
Fabian Ebner
f.ebner at proxmox.com
Wed Jun 10 13:24:00 CEST 2020
Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
New in v2
PVE/VZDump.pm | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index bc4ac751..12c02a2a 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