Merge lp:~axwalk/charm-helpers/hookenv-storage into lp:charm-helpers
Proposed by
Andrew Wilkins
Status: | Merged |
---|---|
Merged at revision: | 455 |
Proposed branch: | lp:~axwalk/charm-helpers/hookenv-storage |
Merge into: | lp:charm-helpers |
Diff against target: |
126 lines (+108/-0) 2 files modified
charmhelpers/core/hookenv.py (+32/-0) tests/core/test_hookenv.py (+76/-0) |
To merge this branch: | bzr merge lp:~axwalk/charm-helpers/hookenv-storage |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Van Steenburgh | Approve | ||
Review via email: mp+272076@code.launchpad.net |
Description of the change
This MP adds two new functions to hookenv: storage_list and storage_get. These will, respectively, list and get details of the unit's storage attachments.
storage_list will return [] of the storage-list hook tool cannot be found in $PATH. storage_get does not filter exceptions, because there's no reason to use it unless you're in a storage hook, or you've called it with the results of storage_list. As such, the following sort of code:
for s in storage_list():
will work regardless of the version of Juju.
To post a comment you must log in.
The last three tests all do:
self. assertEqual( result, result)
...which will always be true. Presumably an oversight, but one of those 'result' vars needs to be renamed in each test.