~thedac/charm-helpers/volume-fixes

Viewing all changes in revision 31.

  • Committer: Matthew Wedgwood
  • Date: 2013-06-19 19:40:12 UTC
  • mfrom: (24.3.6 caching_hookenv)
  • Revision ID: matthew.wedgwood@canonical.com-20130619194012-vsm1w77g1fh3b56z
[james-page] Various refactoring + additions to hookenv

1) cached decorator

Allows caching of function + args to avoid repeated calls out the cli
to juju commands.

2) Normalizing missing unit/config/relation data to None

relation_get('missing') == None
config('missing') == None
unit_get('missing') == None

3) Normalized use of the Serializable object a bit

And added a unit test to cover missing attribute lookups

Question: maybe this should actually return 'None' rather than throwing
an exception inline with 2).

4) Tweaks some tests to be closer to juju behaviour with json

5) Tidied misc pep8/pylint warnings.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: