Don't replace scfg data

Fix TheGrandWazoo/freenas-proxmox#107
This commit is contained in:
Hans 2022-02-24 01:07:32 +08:00 committed by GitHub
parent bcf0f78514
commit 4b0ec91508
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -512,10 +512,11 @@ sub freenas_iscsi_create_extent {
my $name = $lun_path; my $name = $lun_path;
$name =~ s/^.*\///; # all from last / $name =~ s/^.*\///; # all from last /
my $pool = $scfg->{'pool'};
if ($product_name eq "TrueNAS-SCALE") { if ($product_name eq "TrueNAS-SCALE") {
$scfg->{'pool'} =~ s/\//-/; $pool =~ s/\//-/;
} }
$name = $scfg->{'pool'} . ($product_name eq "TrueNAS-SCALE" ? '-' : '/') . $name; $name = $pool . ($product_name eq "TrueNAS-SCALE" ? '-' : '/') . $name;
my $device = $lun_path; my $device = $lun_path;
$device =~ s/^\/dev\///; # strip /dev/ $device =~ s/^\/dev\///; # strip /dev/