New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce verbose ansible and set a basic one #19256
base: master
Are you sure you want to change the base?
Conversation
It has been removed unused ansible output from openQA when it is deploy a hana cluster.
Remove unused ansible output.
Great PR! Please pay attention to the following items before merging: Files matching
This is an automatically generated QA checklist based on modified files. |
@@ -540,7 +540,7 @@ sub qesap_execute_conditional_retry { | |||
$args{retries} //= 1; | |||
|
|||
my @ret = qesap_execute(cmd => $args{cmd}, | |||
verbose => $args{verbose}, | |||
($args{cmd} eq 'ansible' ? () : (verbose => '--verbose')), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strange syntax in the middle of conditional code. How it works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If $args{cmd} is equal to 'ansible', the condition is true, so () is returned. This is an empty list.
If $args{cmd} is not equal to 'ansible', the condition is false, so (verbose => '--verbose') is returned. That means verbosity will be activate with the '-vvv'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If $args{cmd}
is the same as the ansible
string, then return an empty list; otherwise return a list with 2 elements: verbose
and --verbose
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have to add that this works because the ternary operator is limiting a list of 0 or 2 elements from being added to %args
... if it were an odd number, it could create trouble.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, but:
1. Can we get some examples on how the ansible output looks with and without these commits
2. Can you clean up the commits in the PR? You have 7 commits for a change that's not too big. The commits also include 4 branch merges which shouldn't be propagated to the master branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, but:
- Can we get some examples on how the ansible output looks with and without these commits
- Can you clean up the commits in the PR? You have 7 commits for a change that's not too big. The commits also include 4 branch merges which shouldn't be propagated to the master branch.
Reduce verbosity on ansible outputs