Skip to content

Commit 55f699e

Browse files
committed
Update for issues with Proxmox 7.
- The eval{} block was originally returning a value that would allow execution in the $@ conditional. This changed between Proxmox 6 and 7. Why, no idea at the moment. Also, the original HASH was no longer valid as a variable. I don't like the code block at this moment, I need to do some regression testing to Proxmox 5 and FreeNAS/TrueNAS 11 and 12 to see if I can clean up the conditional block. It was there for a reason I just don't know at this moment.
1 parent 572c81a commit 55f699e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

perl5/PVE/Storage/LunCmd/FreeNAS.pm

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,13 @@ sub freenas_api_check {
395395
$result = decode_json($freenas_rest_connection->responseContent());
396396
};
397397
if ($@) {
398-
$result->{'fullversion'} = $freenas_rest_connection->responseContent();
399-
$result->{'fullversion'} =~ s/^"//g;
398+
$result = $freenas_rest_connection->responseContent();
399+
} else {
400+
$result = $freenas_rest_connection->responseContent();
400401
}
401-
syslog("info", (caller(0))[3] . " : successful : Server version: " . $result->{'fullversion'});
402-
$result->{'fullversion'} =~ s/^((?!\-\d).*)\-(\d+)\.(\d+)\-([A-Za-z]*)(?(?=\-)\-(\d*)\-(\d*)|(\d?)\.?(\d?))//;
402+
$result =~ s/^"//g;
403+
syslog("info", (caller(0))[3] . " : successful : Server version: " . $result);
404+
$result =~ s/^((?!\-\d).*)\-(\d+)\.(\d+)\-([A-Za-z]*)(?(?=\-)\-(\d*)\-(\d*)|(\d?)\.?(\d?))//;
403405
$product_name = $1;
404406
my $freenas_version = sprintf("%02d%02d%02d%02d", $2, $3 || 0, $7 || 0, $8 || 0);
405407
syslog("info", (caller(0))[3] . " : ". $product_name . " Unformatted Version: " . $freenas_version);

0 commit comments

Comments
 (0)