chaos / powerman

cluster power control
GNU General Public License v2.0
43 stars 19 forks source link

redfishpower: refactor internals to use plugs #160

Closed chu11 closed 7 months ago

chu11 commented 8 months ago

Problem: Redfishpower was originally written with only "hosts" in mind, however the correct terminology is for powerman devices to operate with "plugs". In most cases, redfishpower "hosts" are simply the same names as the "plugs".

Internally refactor everything to operate on "plugs". This refactor includes:


This PR now precedes #157

chu11 commented 8 months ago

ok, re-worked this PR (and the PR series) to use a broken out "plugs" module. Now all plugs data is in the struct plugs_data struct and many of the functions are now in the "plugs" module.

garlick commented 8 months ago

Looking at what comes next, it might simplify the code a little if this were structured like a true class, e.g. with create/destroy functions. Then you wouldn't need to keep a flag to remember if plugs were initialized (just set to object to NULL) or have a "destructor" that removes plugs while iterating the hostlist. Just a thought.

chu11 commented 7 months ago

re-pushed, making the plugs module more like a class. i'll rebase follow on PRs later.