Merge lp://qastaging/~free.ekanayaka/landscape-charm/dont-restart-services-unnecessarily into lp://qastaging/~landscape/landscape-charm/trunk
Status: | Merged |
---|---|
Approved by: | Free Ekanayaka |
Approved revision: | 310 |
Merged at revision: | 309 |
Proposed branch: | lp://qastaging/~free.ekanayaka/landscape-charm/dont-restart-services-unnecessarily |
Merge into: | lp://qastaging/~landscape/landscape-charm/trunk |
Diff against target: |
401 lines (+238/-35) 5 files modified
lib/callbacks/filesystem.py (+3/-7) lib/callbacks/scripts.py (+55/-12) lib/callbacks/tests/test_scripts.py (+89/-10) lib/tests/test_utils.py (+52/-6) lib/utils.py (+39/-0) |
To merge this branch: | bzr merge lp://qastaging/~free.ekanayaka/landscape-charm/dont-restart-services-unnecessarily |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Björn Tillenius (community) | Approve | ||
Adam Collard (community) | Approve | ||
🤖 Landscape Builder | test results | Approve | |
Review via email: mp+261696@code.qastaging.launchpad.net |
Commit message
This branch makes the LSCtl callback a bit smarter and avoid restarting services in a few situations that don't require a restart. For instance:
- If the SSL certificate change (since we don't load it in memory)
- If the postgresql relation data changed in a way that doesn't affect connection details (for example a new landscape-server unit was added and it's popping up in the allowed_units key).
There is also a small cleanup of repeated logic for finding a certain key in the required_data list of a ServiceManager.
Description of the change
This branch makes the LSCtl callback a bit smarter and avoid restarting services in a few situations that don't require a restart. For instance:
- If the SSL certificate change (since we don't load it in memory)
- If the postgresql relation data changed in a way that doesn't affect connection details (for example a new landscape-server unit was added and it's popping up in the allowed_units key).
There is also a small cleanup of repeated logic for finding a certain key in the required_data list of a ServiceManager.
Note that since this is mainly an optimization it's a bit hard to add an integration test for it. Perhaps we could look at the logs, but it's quite brittle and would somehow depend on test ordering. Maybe we can find a good way later down the road if we want.
Command: make ci-test /ci.lscape. net/job/ latch-test/ 1360/
Result: Success
Revno: 309
Branch: lp:~free.ekanayaka/landscape-charm/dont-restart-services-unnecessarily
Jenkins: https:/