Add support for smart command - slightly different#24
Open
jbrekle wants to merge 2 commits intoChronial:masterfrom
Open
Add support for smart command - slightly different#24jbrekle wants to merge 2 commits intoChronial:masterfrom
smart command - slightly different#24jbrekle wants to merge 2 commits intoChronial:masterfrom
Conversation
… health statistics. this feature can be enabled by a new config option called 'smart' allow for the stdout to be logged (so it is part of the report mail).
smart command - slightly differentsmart command - slightly different
Chronial
requested changes
Dec 29, 2019
Owner
Chronial
left a comment
There was a problem hiding this comment.
Thx for the PR. Some minor comments:
| Raises subprocess.CalledProcessError if errorlevel != 0 | ||
| """ | ||
| stdout_level = logging.INFO if log_output else logging.OUTPUT | ||
| stderr_level = logging.ERROR if log_output else logging.OUTERR |
Owner
There was a problem hiding this comment.
Why do you change the loglevel of stderr here?
|
|
||
|
|
||
| def snapraid_command(command, args={}, *, allow_statuscodes=[]): | ||
| def snapraid_command(command, args={}, *, allow_statuscodes=[], log_output = False): |
Owner
There was a problem hiding this comment.
IMO log_ouput is not the right name for this. The output is always logged. It's just that if the user sets the email preference to short, stdout is not included in the email. increase_output_loglevel would be better. Also please follow pep8.
Suggested change
| def snapraid_command(command, args={}, *, allow_statuscodes=[], log_output = False): | |
| def snapraid_command(command, args={}, *, allow_statuscodes=[], | |
| increase_output_loglevel=False): |
Comment on lines
+10
to
+11
| ; prints a SMART report of all the disks of the array. | ||
| smart = true |
Owner
There was a problem hiding this comment.
I'd prefer for this to be false. Otherwise the script will fail per default if the user doesn't have smartctrl. Also a note Make sure smartctl is in your PATH. in the comment would be helpful.
smart command - slightly differentsmart command - slightly different
This file contains hidden or 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
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.
Hi, I made this pull request without noticing there is already a similar one (#15 ). But it seems conflicted and inactive so I open mine anyway.