From e4803372391c47402798ea70d241eb766f07d6c7 Mon Sep 17 00:00:00 2001 From: digimer Date: Thu, 28 Sep 2023 11:47:48 -0400 Subject: [PATCH] Fixed wait loop for subnodes Signed-off-by: digimer --- tools/anvil-join-anvil | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/anvil-join-anvil b/tools/anvil-join-anvil index 6aef2ce8..6ce721dc 100755 --- a/tools/anvil-join-anvil +++ b/tools/anvil-join-anvil @@ -2406,7 +2406,7 @@ sub wait_for_subnodes update_progress($anvil, $anvil->data->{job}{progress}, "job_0477"); while($waiting) { - my $waiting = 0; + my $ready = 1; foreach my $host_uuid ($node1_host_uuid, $node2_host_uuid) { my $host_name = $anvil->data->{hosts}{host_uuid}{$node2_host_uuid}{host_name}; @@ -2434,8 +2434,8 @@ sub wait_for_subnodes if (($maintenance_mode) or (not $configured)) { - $waiting = 1; - $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { waiting => $waiting}}); + $ready = 0; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { ready => $ready }}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 2, key => "job_0475", variables => { subnode => $host_name, @@ -2445,7 +2445,12 @@ sub wait_for_subnodes } } - if ($waiting) + if ($ready) + { + $waiting = 0; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { waiting => $waiting }}); + } + else { $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, 'print' => 1, level => 2, key => "job_0476"}); sleep 5;