* Updated anvil-delete-server to use the new Server->locate method. This
was done as the old Server->locate() was failing to find the server
running on the peer when anvil-delete-server was running on the backup
subnode.
* Updated Server->locate() to search hosts for XML definition and DRBD
configs so that it can record where the server is recorded to run,
even if the server isn't running or defined at the time the locate ran.
Signed-off-by: digimer <mkelly@alteeve.ca>
Ifthetargetwasnotaccessible,C<<access>>issettoC<<0>>.Thisismeanttoallowtellingthedifferencebetween"we know there's no servers on that host"versus"we don't know what's there because we couldn't access it".
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { server_name => $server_name }});
}
my $server_host = "";
foreach my $host_uuid (@{$hosts})
# Find the server on hosts.
my $server_host_name = $anvil->Server->locate({
debug => 2,
server_name => $server_name,
});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { server_host_name => $server_host_name }});
foreach my $short_host_name (sort {$a cmp $b} keys %{$anvil->data->{server_location}{host}})
{
if ($host_uuid eq $anvil->Get->host_uuid)
my $host_uuid = $anvil->Database->get_host_uuid_from_string({string => $short_host_name});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
short_host_name => $short_host_name,
host_uuid => $host_uuid,
}});
my $exists = 0;
if (($anvil->data->{server_location}{host}{$short_host_name}{server}{$server_name}{file_definition}) or ($anvil->data->{server_location}{host}{$short_host_name}{server}{$server_name}{drbd_config}))
{
# This is us.
$anvil->Server->find({refresh => 0});
$exists = 1;
}
else
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { 'exists' => $exists }});
if (($exists) or
($host_uuid eq $anvil->data->{anvils}{anvil_uuid}{$anvil_uuid}{anvil_node1_host_uuid}) or