Bug 51938 - don't send mails in dry-run in result hook example
don't send mails in dry-run in result hook example
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Import scripts
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v7
Assigned To: Daniel Tröder
Tobias Wenzel
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-09-02 18:41 CEST by Daniel Tröder
Modified: 2020-10-12 16:19 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 2: Improvement: Would be a product improvement
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2020-09-02 18:41:21 CEST
When copied to /usr/share/doc/ucs-school-import/pyhooks, the UCS@school import always executes the hook result_hook_example.py. An email is sent to the recipient even if only the dry-run was executed.

Fix the example hook result_hook_example.py to only run if no dry-run is executed.
Comment 1 Daniel Tröder univentionstaff 2020-09-02 18:44:10 CEST
Fixed in branch dtroeder/51938_result_hook:

[951000a96] Bug #51938: only run hook if not in dry-run (or forced)

Reopen for merge and build.
Comment 2 Tobias Wenzel univentionstaff 2020-09-18 13:44:41 CEST
QA -> All OK -> REOPEN for merge & build

Code -> OK
Functionality -> Code for email notifications is skipped if dry_run == True or the variable SEND_AFTER_DRY_RUN == True
Comment 3 Daniel Tröder univentionstaff 2020-09-29 10:44:26 CEST
[4.4] d0f61cc5b Bug #51938: only run hook if not in dry-run (or forced)
[4.4] eaccc883f Bug #51938: Merge branch 'dtroeder/51938_result_hook' into 4.4
[4.4] 809c9ebb4 Bug #51938: changelog
[4.4] 0fb669104 Bug #51938: advisory

ucs-school-import (17.0.46)
Comment 4 Tobias Wenzel univentionstaff 2020-09-29 11:14:32 CEST
QA -> All OK -> Set to VERIFIED

Changelog -> OK
YAML -> OK
Merged without conflicts.
Comment 5 Daniel Tröder univentionstaff 2020-10-12 16:19:02 CEST
UCS@school 4.4 v7 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.4v7-de.html

If this error occurs again, please clone this bug.