Cleanup of code created issue for some calls to run_lun_command

- When cleaning up code from last commit, I removed a line from the
run_lun_command that initialize the code thinking that the way it would
work would be throught the freenas_api_check when calling the
freenas_api_call. Well certain procedures from the Proxmox ZFSPlugin
call procedures that do not have the $freenas_api_methods variable set
yet because freenas_api_check has NOT been called yet. Inserted the
freenas_api_check() in the run_lun_command() to get the variable
initialized. Fixes #62 and other tests that I found to have this issue.
freenas-proxmox-2.0.0-0beta4 will also have the fix.
This commit is contained in:
Kevin Scott Adams 2020-07-20 09:59:52 -04:00
parent 3e128e673c
commit b4a9cd27ea
1 changed files with 4 additions and 0 deletions

View File

@ -130,6 +130,10 @@ sub run_lun_command {
die "Undefined freenas_user and/or freenas_password.";
}
if (!defined $freenas_server_list->{defined($scfg->{freenas_apiv4_host}) ? $scfg->{freenas_apiv4_host} : $scfg->{portal}}) {
freenas_api_check($scfg);
}
if($method eq "create_lu") {
return run_create_lu($scfg, $timeout, $method, @params);
}