Merge pull request #111 from hans00/master

Fix bug for TrueNAS-SCALE
This commit is contained in:
Kevin Scott Adams 2022-03-02 08:57:03 -05:00 committed by GitHub
commit 08bd48f35c
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/