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.
This commit is contained in:
parent
572c81a95e
commit
55f699e0b1
|
|
@ -395,11 +395,13 @@ sub freenas_api_check {
|
|||
$result = decode_json($freenas_rest_connection->responseContent());
|
||||
};
|
||||
if ($@) {
|
||||
$result->{'fullversion'} = $freenas_rest_connection->responseContent();
|
||||
$result->{'fullversion'} =~ s/^"//g;
|
||||
$result = $freenas_rest_connection->responseContent();
|
||||
} else {
|
||||
$result = $freenas_rest_connection->responseContent();
|
||||
}
|
||||
syslog("info", (caller(0))[3] . " : successful : Server version: " . $result->{'fullversion'});
|
||||
$result->{'fullversion'} =~ s/^((?!\-\d).*)\-(\d+)\.(\d+)\-([A-Za-z]*)(?(?=\-)\-(\d*)\-(\d*)|(\d?)\.?(\d?))//;
|
||||
$result =~ s/^"//g;
|
||||
syslog("info", (caller(0))[3] . " : successful : Server version: " . $result);
|
||||
$result =~ s/^((?!\-\d).*)\-(\d+)\.(\d+)\-([A-Za-z]*)(?(?=\-)\-(\d*)\-(\d*)|(\d?)\.?(\d?))//;
|
||||
$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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue