-
Notifications
You must be signed in to change notification settings - Fork 18
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
powerman: when status and status_all are defined, use status_all only on full pluglist #156
Conversation
71d07fa
to
a97bd5e
Compare
Nice! This probably needs test coverage though. |
Ahh, yeah. I guess it was sort of there in the bigger PR, but could use some specific tests targeted just to this. |
a97bd5e
to
653f335
Compare
re-pushed, added some coverage in t0004-status-query.t. Edit: oops bash is ok with == but not dash. |
653f335
to
6793494
Compare
Thanks for the test! Other things:
BTW which script does powerman choose when the device spec contains both |
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.
Oh just realized that this applies to status_beacon_all
.
Hmm, looks like there is a status_temp_all
but no status_temp
?
t/t0004-status-query.t
Outdated
@@ -145,6 +145,72 @@ test_expect_success 'stop powerman daemon and device server' ' | |||
wait && | |||
wait | |||
' | |||
test_expect_success 'create new powerman.conf with no status and status_all script' ' |
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.
s/no/both/
@@ -683,8 +683,12 @@ static int _enqueue_targeted_actions(Device * dev, int com, hostlist_t hl, | |||
pluglist_iterator_destroy(itr); |
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.
Commit message:
Solution: Only call the "all" script if it is a query and a singlet
version of the script does not exist.
Makes it sound like "all" is never called if the singlet exists. Maybe "only call the all
query script if all plugs are requested OR the singlet version of the script is not defined."?
For device files where
unpopulated nodes may exist, it can define an all script and singlet
script for each scenario.
s/nodes/plugs/
TBH I wasn't sure. Adding some printf debug into |
Problem: The "temp" command was missing a "goto ok" statement after completing the temperature request. It lead to unexpected output. Add the missing "goto ok".
6793494
to
4ca5822
Compare
re-pushed ... tweaked nit things per comments above and ...
|
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.
LGTM! Just one commit message suggestion.
script status { | ||
send "pmnode %s\r" | ||
expect "node([0-9]+): (on|off|n/a)" |
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.
In the commit message for this, it would probably be good to mention that the current behavior is changing so that the untested singletons would start to get used, so this change just preserves the existing behavior.
Problem: Current powerman implementation will always call the "all" status script instead of a "singleton" status scripts for power status, beacon status, and temperature status. In the future this behavior will change. Some devices specify both "all" and "singleton" status scripts. This means the "singleton" status scripts are never used and are untested, but with future changes they will begin to be used. Solution: Remove the singleton status scripts in appro-gb2.dev, appro-greenblade.dev, and swpdu.dev. This will preserve current behavior of those device files.
Problem: When selecting a script to use for an action, the "all" version of a script is always used if the action is a query action (e.g. power status query, beacon query, etc.). This can be problematic in situations where blades/nodes/etc. are not fully populated, such as in a chassis. We do not want to query "all" things in that case. Solution: Only call the all query script if all plugs are requested OR the singlet version of the script is not defined."? For device files where unpopulated plugs may exist, it can define an all script and singlet script for each scenario.
Problem: There are no tests to see which status script (status vs status_all) is chosen when both are specified in a device file. Add coverage in t0004-status-query.t, t0007-temperature.t, and t0008-beacon.t.
Problem: Recent updates altered when an "all" vs "singleton" status script is called. However this change is not documented. Add information on why a user might want to specify both an "all" and "singleton" status script for power status, beacon status, and temperature status.
4ca5822
to
ac7726c
Compare
thanks, pushed a commit message tweak and setting MWP |
Problem: When selecting a script to use for an action, the "all" version of a script is always used if the action is a query action (e.g. power status query, beacon query, etc.).
This can be problematic in situations where blades/nodes/etc. are not fully populated, such as in a chassis. We do not want to query "all" things in that case.
Solution: Only call the "all" script if it is a query and a singlet version of the script does not exist. For device files where unpopulated nodes may exist, it can define an all script and singlet script for each scenario.
Built on top of #155