mirror of
https://github.com/TheGrandWazoo/freenas-proxmox.git
synced 2026-10-20 18:57:04 +02:00
Change iscsi_lunid values of 'undef' to 0 (zero)
- In FreeNAS 11.1 it seems like a Lun of 0 becomes 'Auto'. When the API returns the targent_to_extent data any Lun of "Auto" become 'undef' and causes issues and errors in the syslog. This change corrects this behavior. Have tested with adding, detaching, removing and "Moving Disk" functions of Proxmox version 5.1-51.
This commit is contained in:
@@ -359,6 +359,15 @@ sub freenas_iscsi_get_target_to_extent {
|
||||
if ($code == 200) {
|
||||
my $result = decode_json($client->responseContent());
|
||||
syslog("info","FreeNAS::API::get_target_to_extent() : sucessfull");
|
||||
# If 'iscsi_lunid' is undef then it is set to 'Auto' in FreeNAS
|
||||
# which should be '0' in our eyes.
|
||||
# This gave Proxmox 5.x and FreeNAS 11.1 a few issues.
|
||||
foreach my $item (@$result) {
|
||||
if (!defined($item->{'iscsi_lunid'})) {
|
||||
$item->{'iscsi_lunid'} = 0;
|
||||
syslog("info", "FreeNAS::API::get_target_to_extent() : change undef iscsi_lunid to 0");
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
} else {
|
||||
freenas_api_log_error($client, "get_target_to_extent");
|
||||
|
||||
Reference in New Issue
Block a user