Merge pull request #80 from TheGrandWazoo/master
Merge request to v2.0 branch.
This commit is contained in:
commit
837399e62f
|
|
@ -83,7 +83,7 @@ my $freenas_api_version_matrix = {
|
||||||
"type" => "DISK",
|
"type" => "DISK",
|
||||||
"name" => "\$name",
|
"name" => "\$name",
|
||||||
"disk" => "\$device",
|
"disk" => "\$device",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"targetextent" => {
|
"targetextent" => {
|
||||||
"resource" => "/api/v2.0/iscsi/targetextent/",
|
"resource" => "/api/v2.0/iscsi/targetextent/",
|
||||||
|
|
@ -399,9 +399,9 @@ sub freenas_api_check {
|
||||||
$result->{'fullversion'} =~ s/^"//g;
|
$result->{'fullversion'} =~ s/^"//g;
|
||||||
}
|
}
|
||||||
syslog("info", (caller(0))[3] . " : successful : Server version: " . $result->{'fullversion'});
|
syslog("info", (caller(0))[3] . " : successful : Server version: " . $result->{'fullversion'});
|
||||||
$result->{'fullversion'} =~ s/^(\w+)\-(\d+)\.(\d+)\-(?:U|BETA)(\d?)\.?(\d?)//;
|
$result->{'fullversion'} =~ s/^((?!\-\d).*)\-(\d+)\.(\d+)\-([A-Za-z]*)(?(?=\-)\-(\d*)\-(\d*)|(\d?)\.?(\d?))//;
|
||||||
my $freenas_version = sprintf("%02d%02d%02d%02d", $2, $3 || 0, $4 || 0, $5 || 0);
|
|
||||||
$product_name = $1;
|
$product_name = $1;
|
||||||
|
my $freenas_version = sprintf("%02d%02d%02d%02d", $2, $3 || 0, $7 || 0, $8 || 0);
|
||||||
syslog("info", (caller(0))[3] . " : ". $product_name . " Unformatted Version: " . $freenas_version);
|
syslog("info", (caller(0))[3] . " : ". $product_name . " Unformatted Version: " . $freenas_version);
|
||||||
if ($freenas_version >= 11030100) {
|
if ($freenas_version >= 11030100) {
|
||||||
$freenas_api_version = "v2.0";
|
$freenas_api_version = "v2.0";
|
||||||
|
|
@ -439,7 +439,7 @@ sub freenas_api_call {
|
||||||
$freenas_rest_connection = $freenas_server_list->{$apihost};
|
$freenas_rest_connection = $freenas_server_list->{$apihost};
|
||||||
$freenas_global_config = $freenas_global_config_list->{$apihost};
|
$freenas_global_config = $freenas_global_config_list->{$apihost};
|
||||||
my $json_data = (defined $data) ? encode_json($data) : undef;
|
my $json_data = (defined $data) ? encode_json($data) : undef;
|
||||||
$freenas_rest_connection->$method($path, $json_data);
|
$freenas_rest_connection->request($method, $path, $json_data);
|
||||||
syslog("info", (caller(0))[3] . " : successful");
|
syslog("info", (caller(0))[3] . " : successful");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -510,7 +510,7 @@ sub freenas_iscsi_create_extent {
|
||||||
|
|
||||||
my $name = $lun_path;
|
my $name = $lun_path;
|
||||||
$name =~ s/^.*\///; # all from last /
|
$name =~ s/^.*\///; # all from last /
|
||||||
$name = $scfg->{'pool'} . '/' . $name;
|
$name = $scfg->{'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/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue