-
Notifications
You must be signed in to change notification settings - Fork 86
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
Fixes for cciss_vol_status 1.12a #221
Closed
Closed
Conversation
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
The latest version of cciss_vol_status is 1.12a. For the first time, an extra letter was appended. The version pattern would not match any more. The function will return 0, and later on, the code to detect if the version is >= 1.10 (for new added functionality) would wrongly return false. So, change it to also accept an optional letter at the end, but ignore it. Adding it to the detected version string will result in errors like "Argument "1.12a" isn't numeric" later on in the code, and because right now, there is no need to be able to distinguish between 1.12 and 1.12a in the plugin.
In version 1.12a of cciss_vol_status, RAID 1 is changed to RAID1(1+0) which makes the pattern fail. Accept the optional (X+Y). Without this change, no array would be detected, and the program will fail with: UNKNOWN: cciss:[Plugin error]
In version 1.12a, cciss_vol_status changes the output of physical location of drives: - sprintf(tail, " connector %c%c box %d bay %d %40s %40s %8s", + sprintf(tail, " connector %c%c box %d bay %-2d %40s %40s %8s", This means that the bay number is now 2 posititions, left aligned. So, e.g. '1 ', '6 ', or '12'. Allow for an extra space to be present when the bay number is less than 10. Without this change, the pattern will not match any more, and the program complains about Unparsed lines.
Since v1.12, cciss_vol_status outputs these two new extra lines about cache status: Total cache memory: 816 MiB Cache Ratio: 10% Read / 90% Write Make sure we parse them and include them in cstatus, so that they also end up in the test dump files which makes the tests pass again.
This adds a test case which contains all changes to cciss_vol_status 1.12 and 1.12a output.
This code works well and fixes our problems on 3 boxes with varying Debian and cciss_vol_status versions :
|
merged #205 instead |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New PR replacing #205
@glensc I don't really understand why you asked for a new PR, as @knorrie's commits can be merged on the current master without any conflict, but here is a new PR with same code anyway.