Merge lp://qastaging/~ajkavanagh/charm-helpers/clean-up-render into lp://qastaging/charm-helpers
Status: | Merged |
---|---|
Merged at revision: | 782 |
Proposed branch: | lp://qastaging/~ajkavanagh/charm-helpers/clean-up-render |
Merge into: | lp://qastaging/charm-helpers |
Diff against target: |
93 lines (+36/-8) 3 files modified
charmhelpers/contrib/openstack/templating.py (+5/-2) charmhelpers/core/hookenv.py (+1/-0) charmhelpers/core/host.py (+30/-6) |
To merge this branch: | bzr merge lp://qastaging/~ajkavanagh/charm-helpers/clean-up-render |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
David Ames (community) | Approve | ||
Review via email: mp+328859@code.qastaging.launchpad.net |
Description of the change
Update the core.host.
The primary motivation for this change is to do less work, touch the
filesystem less, and try to clean the logs up a bit. This change is
to the rendering of configuration files, which generates noise in the
logs (at INFO) level, and often results in writing the exact same
content, thus updating the atime of the file even when the contents
haven't changed.
This change detects if the content will change, and if not, doesn't
write the file. It does detect if the uid,gid is changing and takes
the appropriate action. The logs are demoted to the lowest level of
DEBUG/TRACE, and are only generated IFF the file is actually written
or the uid/gid is changed.
This looks good.
Before final approval I'd like to see it in one of our charms running an amulet full.
I realize this is a bit chicken and egg. But you can hijack the charm-helpers- hooks.yaml for this purpose.