fix(tools): add target host to vnc info variable

This commit is contained in:
Tsu-ba-me 2023-07-18 15:49:21 -04:00 committed by digimer
parent 0b91ee0314
commit cb98d28eb0

View File

@ -97,7 +97,7 @@ sub build_find_available_port_call
return (0, $call); return (0, $call);
} }
sub build_vncport_variable_name sub build_vncinfo_variable_name
{ {
my ($svr_uuid) = @_; my ($svr_uuid) = @_;
@ -250,20 +250,22 @@ sub set_entry
return (0); return (0);
} }
sub set_vncport_variable sub set_vncinfo_variable
{ {
my $parameters = shift; my $parameters = shift;
my $debug = $parameters->{debug} || 3; my $debug = $parameters->{debug} || 3;
my $end_port = $parameters->{end_port}; my $end_port = $parameters->{end_port};
my $svr_uuid = $parameters->{svr_uuid}; my $svr_uuid = $parameters->{svr_uuid};
$anvil->Log->variables({ source => $THIS_FILE, line => __LINE__, level => $debug, list => $parameters, prefix => "set_vncport_variable" }); $anvil->Log->variables({ source => $THIS_FILE, line => __LINE__, level => $debug, list => $parameters, prefix => "set_vncinfo_variable" });
my $local_host_name = $anvil->data->{sys}{host_name};
my ($variable_uuid) = $anvil->Database->insert_or_update_variables({ my ($variable_uuid) = $anvil->Database->insert_or_update_variables({
file => $THIS_FILE, file => $THIS_FILE,
line => __LINE__, line => __LINE__,
variable_name => build_vncport_variable_name($svr_uuid), variable_name => build_vncinfo_variable_name($svr_uuid),
variable_value => $end_port, variable_value => "${local_host_name}:${end_port}",
}); });
return (1) if (not is_uuid_v4($variable_uuid)); return (1) if (not is_uuid_v4($variable_uuid));
@ -331,7 +333,7 @@ sub start_pipe
my $ws_process = $ws_processes->{pids}{$ws_pid}; my $ws_process = $ws_processes->{pids}{$ws_pid};
($rcode) = set_vncport_variable({ end_port => $ws_process->{sport}, svr_uuid => $svr_uuid, %$common_params }); set_vncinfo_variable({ end_port => $ws_process->{sport}, svr_uuid => $svr_uuid, %$common_params });
return (0); return (0);
} }