Skip to content

Commit

Permalink
powerman: do not always call "all" query script
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chu11 committed Mar 2, 2024
1 parent 0b63035 commit a97bd5e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/powerman/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,12 @@ static int _enqueue_targeted_actions(Device * dev, int com, hostlist_t hl,
pluglist_iterator_destroy(itr);

/* Try _all version of script.
*
* - use if action is a query, unless no singlet version exists
* (i.e. if there is no singlet version, we have to use the _all
* version)
*/
if (all || _is_query_action(com)) {
if (all || (_is_query_action(com) && dev->scripts[com] == NULL)) {
int ncom = _get_all_script(dev, com);

if (ncom != -1) {
Expand Down

0 comments on commit a97bd5e

Please sign in to comment.