Merge lp://staging/~julian-edwards/maas/node-power-monitor-crash into lp://staging/~maas-committers/maas/trunk
Proposed by
Julian Edwards
Status: | Merged |
---|---|
Approved by: | Julian Edwards |
Approved revision: | no longer in the source branch. |
Merged at revision: | 3026 |
Proposed branch: | lp://staging/~julian-edwards/maas/node-power-monitor-crash |
Merge into: | lp://staging/~maas-committers/maas/trunk |
Diff against target: |
50 lines (+29/-0) 2 files modified
src/provisioningserver/rpc/power.py (+3/-0) src/provisioningserver/rpc/tests/test_power.py (+26/-0) |
To merge this branch: | bzr merge lp://staging/~julian-edwards/maas/node-power-monitor-crash |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphaël Badin (community) | Approve | ||
Review via email: mp+235085@code.staging.launchpad.net |
Commit message
Ensure crazy power template results are treated as errors in the power monitoring service. Crazy means not an "on" or a "off". Previously, it would halt the whole scan.
To post a comment you must log in.
Looks good but wouldn't the code be better placed directly inside perform_ power_query( )?
@synchronous power_query( system_ id, hostname, power_type, context):
def perform_
"""Issue the given `power_query` command.
No exception handling is performed here, this allows power_state` to perform multiple queries and only power_type) execute( power_change= 'query' , **context) (power_ state)
`get_
log the final error.
"""
action = PowerAction(
power_state = action.
if power_state in ("on", "off"):
return power_state
else:
raise PowerActionFail