-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
powerman: support new setresult directive
Problem: Powerman device files can be scripted to "expect" a string to indicate success. In the event of a failure (i.e. an unexpected string output), the device script will ultimately time out. This is undesirable as it can slow down powerman when simple errors (e.g. "password failure") fail immediately. The lack of the ability to "fail fast" has lead to many device scripts being scripted to simply "succeed" most of the time. Powerman will complete with "Command completed successfully" regardless if the power operation was a success or not. Solution: Support a new "setresult" statement that can inform powerman that a power operation did not succeed. A regex can be used to determine what output is expected of a successful power operation. If any are not successful, powerman can immediately report to the user an error has occurred, leading to a "Command completed with errors" message and exit status 1. Some example uses: script on_all { send "on\n" foreachnode { expect "([^\n:]+): ([^\n]+\n)" setresult $1 $2 success="^ok\n" } expect "redfishpower> " } script on { send "on %s\n" expect "([^\n:]+): ([^\n]+\n)" setresult $1 $2 success="^ok\n" expect "redfishpower> " } Fixes #79
- Loading branch information
Showing
6 changed files
with
214 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.