Added a check to see if the server's UUID exists and looping if not to prevent unitialized variable warnings.

Signed-off-by: digimer <mkelly@alteeve.ca>
main
digimer 2 years ago
parent 660f38ac16
commit 9bf0f50084
  1. 6
      tools/anvil-provision-server

@ -394,6 +394,12 @@ sub write_definition
$anvil->Database->get_servers(); $anvil->Database->get_servers();
$anvil->Database->get_server_definitions(); $anvil->Database->get_server_definitions();
if (not exists $anvil->data->{servers}{anvil_uuid}{$anvil_uuid}{server_name}{$server_name}{server_uuid})
{
sleep 1;
next;
}
my $server_uuid = $anvil->data->{servers}{anvil_uuid}{$anvil_uuid}{server_name}{$server_name}{server_uuid}; my $server_uuid = $anvil->data->{servers}{anvil_uuid}{$anvil_uuid}{server_name}{$server_name}{server_uuid};
my $server_definition = exists $anvil->data->{server_definitions}{server_definition_server_uuid}{$server_uuid} ? $anvil->data->{server_definitions}{server_definition_server_uuid}{$server_uuid}{server_definition_xml} : ""; my $server_definition = exists $anvil->data->{server_definitions}{server_definition_server_uuid}{$server_uuid} ? $anvil->data->{server_definitions}{server_definition_server_uuid}{$server_uuid}{server_definition_xml} : "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { server_definition => $server_definition }}); $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { server_definition => $server_definition }});

Loading…
Cancel
Save