Merge lp://qastaging/~michael.nelson/charm-helpers/ensure_etc_salt_exists into lp://qastaging/charm-helpers

Proposed by Michael Nelson
Status: Merged
Merged at revision: 58
Proposed branch: lp://qastaging/~michael.nelson/charm-helpers/ensure_etc_salt_exists
Merge into: lp://qastaging/charm-helpers
Diff against target: 95 lines (+24/-4)
5 files modified
Makefile (+4/-0)
charmhelpers/contrib/saltstack/__init__.py (+5/-0)
tests/contrib/jujugui/test_utils.py (+2/-0)
tests/contrib/saltstack/test_saltstates.py (+5/-4)
tests/core/test_hookenv.py (+8/-0)
To merge this branch: bzr merge lp://qastaging/~michael.nelson/charm-helpers/ensure_etc_salt_exists
Reviewer Review Type Date Requested Status
Matthew Wedgwood (community) Approve
Review via email: mp+170546@code.qastaging.launchpad.net

Description of the change

When installing only the salt-common lib, the /etc/salt directory is not created (at least with the version I'm using from lamont).

This branch was just going to ensure that the dir exists before it writes out the grains for use in templates...

...but, while QAing this branch on my charm, I came across some changed behaviour in hookenv.relation_get(). When run in the context of no relation, it used to return None, now it returns Serializable(None).

What I was seeing was this http://paste.ubuntu.com/5783035/

So I added a test to demo the issue and fixed it. Just in terms of consistency, I'm not sure whether it's intended that hookenv.unit_get always returns a dict (result of json.loads) rather than a Serializable (when the result isn't None, that is).

Finally, I got sick of waiting for one specific test to finish when doing `make test`, so added `make ftest` for use while developing.

To post a comment you must log in.
Revision history for this message
Matthew Wedgwood (mew) wrote :

Hi, Michael,

Looks like stub's submitted an MP that removes the automatic decoration of those values with Serializable. I think that's a sensible solution and I think it should simplify things for you. That MP needs a bit of work before it can be merged.

If stub doesn't have the time to fix up the tests, I can probably get to that early next week.

Revision history for this message
Matthew Wedgwood (mew) wrote :

Because of r42, this needs rebasing to trunk.

review: Needs Fixing
37. By Michael Nelson

Merged trunk and resolved conflict.

38. By Michael Nelson

Removed an unnecessary change left from the merge.

39. By Michael Nelson

Remove no-longer-relevant test comment.

Revision history for this message
Michael Nelson (michael.nelson) wrote :

Thanks Matthew - just getting back from a week off. I've merged trunk and resolved the conflicts. Diff should look better now with r39.

I've left the new test in there that I added for hook_env, as I don't see another one there for relation_get returning None.

Revision history for this message
Michael Nelson (michael.nelson) wrote :

Ping? :)

Revision history for this message
Matthew Wedgwood (mew) wrote :

Thanks for the re-merge, Michael, and sorry for the delay. Looks good now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches