Skip to content

Conversation

@brott8
Copy link

@brott8 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,
Copy link
Owner

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

Copy link
Author

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)) *$',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this

Copy link
Author

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
Comment on lines 714 to 715
apprise_report = create_apprise_report(report_data)
send_apprise('SnapRAID Job Completed Successfully', apprise_report)
Copy link
Owner

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?

Copy link
Author

@brott8 brott8 Sep 1, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants