-
Notifications
You must be signed in to change notification settings - Fork 5
Integration of Apprise notification services as a configurable option #14
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
base: main
Are you sure you want to change the base?
Conversation
brott8
commented
Jul 21, 2024
- Integration of Apprise notification services for Snapraid process results.
- Handling split parity in sanity checks
…on for Snapraid process results. - Update of touch regex to account for "a" in versions of Snapraid - Handling split parity in sanity checks
snapper.py
Outdated
| snapraid_status, flags=re.MULTILINE) | ||
| zero_subsecond_count = re.search( | ||
| r'^You have (?P<touch_files>\d+) files with (?:a )?zero sub-second timestamp', snapraid_status, | ||
| r'^You have (?P<touch_files>\d+) files with( a)? zero sub-second timestamp', snapraid_status, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please change this back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I must have had an old version that I merged against. I'll amend.
snapper.py
Outdated
|
|
||
| file_regex = re.compile(r'^(content|(?:\d+-)?parity) +(.+/\w+.(?:content|(?:\d+-)?parity)) *$', | ||
| #Split parity handling | ||
| file_regex = re.compile(r'^(content|parity) +(.+/\w+.(?:content|parity)) *$', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above - I'll amend this. Split parity is obviously already handled in your regex.
snapper.py
Outdated
| apprise_report = create_apprise_report(report_data) | ||
| send_apprise('SnapRAID Job Completed Successfully', apprise_report) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these be guarded to ensure the feature is enabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I followed your send_mail implementation. This relies on the enabled flag within the routine to guard. It won't execute if not enabled:
is_enabled, apprise_bin, config_loc = itemgetter(
'enabled', 'binary', 'config')(config['notifications']['apprise'])
if not is_enabled:
return
The main downside of this approach is that the template execution runs every time regardless. I can suggest bringing the enabled flag into the main routine for both email and apprise, following your discord implementation.
- Reverting touch regex - Reverting regex for split parity