[pve-devel] [PATCH v2 storage 3/3] change var name ct to type to prevent confusion with container
Tim Marx
t.marx at proxmox.com
Wed Nov 20 11:35:18 CET 2019
Signed-off-by: Tim Marx <t.marx at proxmox.com>
---
PVE/Storage/Plugin.pm | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm
index 2bf6f0a..c2612c1 100644
--- a/PVE/Storage/Plugin.pm
+++ b/PVE/Storage/Plugin.pm
@@ -938,21 +938,21 @@ sub list_volumes {
my $res = [];
my $vmlist = PVE::Cluster::get_vmlist();
- foreach my $ct (@$content_types) {
+ foreach my $type (@$content_types) {
my $data;
- if ($ct eq 'images' || $ct eq 'rootdir') {
+ if ($type eq 'images' || $type eq 'rootdir') {
$data = $class->list_images($storeid, $scfg, $vmid);
} elsif ($scfg->{path}) {
- my $path = $class->get_subdir($scfg, $ct);
+ my $path = $class->get_subdir($scfg, $type);
- if ($ct eq 'iso' && !defined($vmid)) {
+ if ($type eq 'iso' && !defined($vmid)) {
$data = $get_subdir_files->($storeid, $path, 'iso');
- } elsif ($ct eq 'vztmpl'&& !defined($vmid)) {
+ } elsif ($type eq 'vztmpl'&& !defined($vmid)) {
$data = $get_subdir_files->($storeid, $path, 'vztmpl');
- } elsif ($ct eq 'backup') {
+ } elsif ($type eq 'backup') {
$data = $get_subdir_files->($storeid, $path, 'backup', $vmid);
- } elsif ($ct eq 'snippets') {
+ } elsif ($type eq 'snippets') {
$data = $get_subdir_files->($storeid, $path, 'snippets');
}
}
@@ -960,7 +960,7 @@ sub list_volumes {
next if !$data;
foreach my $item (@$data) {
- if ($ct eq 'images' || $ct eq 'rootdir') {
+ if ($type eq 'images' || $type eq 'rootdir') {
my $vmtype = $vmlist->{ids}->{$item->{vmid}}->{type};
next if (!defined($vmtype));
@@ -970,12 +970,12 @@ sub list_volumes {
if ($vmtype eq 'qemu') {
$item->{content} = 'images';
}
- if (!($ct eq $item->{content})) {
+ if (!($type eq $item->{content})) {
next;
}
} else {
- $item->{content} = $ct;
+ $item->{content} = $type;
}
push @$res, $item;
--
2.20.1
More information about the pve-devel
mailing list