-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add function to check if nodes are reachable via bolt
At the moment the plans assume that all nodes are available. I had a few customer setups where one of the compilers wasn't reachable during a convert/upgrade. To not put the PE infra into an undefined state, it makes sense to check the availability before running the plans.
- Loading branch information
1 parent
a99cb66
commit 4f4a9cd
Showing
5 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# | ||
# @summary check if a group of targets are reachable for bolt | ||
# | ||
# @param targets list of targets that are going to be checked | ||
# @param output_details flag to enable/disable error output for failed nodes | ||
# | ||
# @return counter for unavailable nodes | ||
# | ||
# @author Tim Meusel <[email protected]> | ||
# | ||
function peadm::check_availability(TargetSpec $targets, Boolean $output_details = true) >> Integer { | ||
$check_result = wait_until_available($targets, wait_time => 2, _catch_errors => true) | ||
if $check_result.ok { | ||
} elsif $output_details { | ||
$check_result.error_set.each |$result| { | ||
out::message("## node ${result.target} has connection error '${result.error.kind}' with message '${result.error.msg}'") | ||
} | ||
} | ||
|
||
return $check_result.error_set.count | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters