Merge ~txiao/charm-logrotated:handle_unset into charm-logrotated:master
Status: | Merged |
---|---|
Approved by: | Robert Gildein |
Approved revision: | 8746e270196d0464b2c4e230f34cec756da15f11 |
Merged at revision: | a137eb7f109dca499ec59fe7bcc7c47ee93d4596 |
Proposed branch: | ~txiao/charm-logrotated:handle_unset |
Merge into: | charm-logrotated:master |
Diff against target: |
130 lines (+43/-10) 3 files modified
src/lib/lib_cron.py (+20/-8) src/reactive/logrotate.py (+14/-2) src/tests/unit/test_logrotate.py (+9/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
🤖 prod-jenkaas-bootstack (community) | continuous-integration | Approve | |
Robert Gildein | Approve | ||
Eric Chen | Needs Fixing | ||
Kamal Bhaskar | Approve | ||
Review via email: mp+441130@code.launchpad.net |
Commit message
Handle "unset" value of update-
Description of the change
Previously, validating "unset" value would result in silent error because:
1. the con_mapping in CronHelper.
which leads to an attemption of concatenating str with NoneType in later lines
2. wrongly checking index 0 of a str instead of list for self.cron_
in CronHelper.
3. wrong logic for setting status in install and config_changed hook, which means
the workload always ends up in "active" even when exceptions are raised
4. didn't set workload status to blocked when executing cronjob.
This commit fixes the above mentioned issues and added related unit tests.
Additionally, more logs are added to provide extra information.
This merge proposal is being monitored by mergebot. Change the status to Approved to merge.