Reworked host validation to avoid warnings in logs.

Signed-off-by: digimer <mkelly@alteeve.ca>
main
digimer 8 months ago
parent bd2e4c46ae
commit ec6acdd6d8
  1. 11
      Anvil/Tools/Remote.pm

@ -1249,18 +1249,19 @@ sub _check_known_hosts_for_target
my $target_host_uuid = ""; my $target_host_uuid = "";
my $target_host_name = ""; my $target_host_name = "";
if ($anvil->Validate->ip({debug => $debug, ip => $target}))
if ($anvil->Validate->host_name({debug => $debug, name => $target}))
{ {
($target_host_uuid, $target_host_name) = $anvil->Get->host_from_ip_address({debug => $debug, ip_address => $target}); $target_host_name = $target;
$target_host_uuid = $anvil->Get->host_uuid_from_name({host_name => $target});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => 0, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => 0, list => {
target_host_uuid => $target_host_uuid, target_host_uuid => $target_host_uuid,
target_host_name => $target_host_name, target_host_name => $target_host_name,
}}); }});
} }
else elsif ($anvil->Validate->ip({debug => $debug, ip => $target}))
{ {
$target_host_name = $target; ($target_host_uuid, $target_host_name) = $anvil->Get->host_from_ip_address({debug => $debug, ip_address => $target});
$target_host_uuid = $anvil->Get->host_uuid_from_name({host_name => $target});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => 0, list => { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, secure => 0, list => {
target_host_uuid => $target_host_uuid, target_host_uuid => $target_host_uuid,
target_host_name => $target_host_name, target_host_name => $target_host_name,

Loading…
Cancel
Save