refactor storage whitelist in sync_disks to regex

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-12-04 18:40:03 +01:00
parent 4c2f3755c7
commit dad06e2068

View File

@ -426,8 +426,7 @@ sub sync_disks {
my ($sid, $volname) = PVE::Storage::parse_volume_id($volid); my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
my $scfg = PVE::Storage::storage_config($self->{storecfg}, $sid); my $scfg = PVE::Storage::storage_config($self->{storecfg}, $sid);
my $migratable = ($scfg->{type} eq 'dir') || ($scfg->{type} eq 'zfspool') || my $migratable = $scfg->{type} =~ /^(?:dir|zfspool|lvmthin|lvm)$/;
($scfg->{type} eq 'lvmthin') || ($scfg->{type} eq 'lvm');
die "can't migrate '$volid' - storage type '$scfg->{type}' not supported\n" die "can't migrate '$volid' - storage type '$scfg->{type}' not supported\n"
if !$migratable; if !$migratable;