Merge lp://staging/~niedbalski/charm-helpers/fix-1699565 into lp://staging/charm-helpers

Proposed by Jorge Niedbalski
Status: Superseded
Proposed branch: lp://staging/~niedbalski/charm-helpers/fix-1699565
Merge into: lp://staging/charm-helpers
Diff against target: 71 lines (+46/-0)
2 files modified
charmhelpers/contrib/openstack/utils.py (+12/-0)
tests/contrib/openstack/test_os_utils.py (+34/-0)
To merge this branch: bzr merge lp://staging/~niedbalski/charm-helpers/fix-1699565
Reviewer Review Type Date Requested Status
Felipe Reyes (community) Approve
Review via email: mp+326111@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2017-06-22.

Description of the change

Partial fix required for LP: #1699565.

To post a comment you must log in.
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

Does this really need to be in charm-helpers? It seems to be something that could just be done in the glance charm. The function 'update_policy(...)' would have to also be mocked out in the glance charm to test the code that it will be using.

Are you seeing other use cases that means that it will be used across many charms? Thanks.

Revision history for this message
Felipe Reyes (freyes) wrote :

I agree with having this in charm-helpers, because I'm aware of at least 1 other charm that could benefit from this (keystone charm). We update the policy.json when v3 is enabled.

review: Approve
Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

Okay, if it is needed, then it should have a more generic name. It's essentially updating a json file, not particularly a policy file, so:

    def update_json_file(filename, items):
        ....

would make it more usable from a re-use perspective. i.e. there's nothing in the function that dictates that it's a policy file only. And this is a utils library module.

757. By Jorge Niedbalski

Modified file to update_json_file

Unmerged revisions

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