Merge lp://qastaging/~thedac/charms/trusty/neutron-api/status into lp://qastaging/~openstack-charmers-archive/charms/trusty/neutron-api/next

Proposed by David Ames
Status: Work in progress
Proposed branch: lp://qastaging/~thedac/charms/trusty/neutron-api/status
Merge into: lp://qastaging/~openstack-charmers-archive/charms/trusty/neutron-api/next
Diff against target: 638 lines (+246/-37)
6 files modified
hooks/charmhelpers/contrib/openstack/context.py (+8/-0)
hooks/charmhelpers/contrib/openstack/utils.py (+83/-1)
hooks/charmhelpers/core/hookenv.py (+84/-16)
hooks/neutron_api_hooks.py (+25/-1)
hooks/neutron_api_utils.py (+8/-0)
unit_tests/test_neutron_api_hooks.py (+38/-19)
To merge this branch: bzr merge lp://qastaging/~thedac/charms/trusty/neutron-api/status
Reviewer Review Type Date Requested Status
James Page Needs Fixing
Review via email: mp+264315@code.qastaging.launchpad.net

Commit message

Add workload status settings

Description of the change

Based on Liam Young's original work add workload status settings to the neutron-api charm as a proof of concept.

The plan is to move context_status, set_context_status and incomplete_contexts to charmhelpers.

Looking for feedback before proceeding.

To post a comment you must log in.
Revision history for this message
David Ames (thedac) wrote :
118. By David Ames

More status sets for install process

119. By David Ames

Use functools wraps

120. By David Ames

With @wraps in the decorator can now apply context_status to *_joined functions

121. By David Ames

Set status when waiting on a particular variable in a given context
Compound the status messages keeping the highest priority workload state

Revision history for this message
David Ames (thedac) wrote :

charmhelpers.contrib.openstack.context.context_complete now sets a waiting state when missing specific data. It uses status_compound which takes in the current status and a new state and message and "adds" them together keeping the most severe workload state and concatenating the messages.

It is important to note that in practice these statuses are ephemeral as the context_status decorator comes around and runs set_context_status which is a bit more of a hammer. This is necessary to make sure we set a known state rather than just the last set state wins.

I am very much open to ideas to get us further granularity into set_context_status. set_context_status relies on charmhelpers.contrib.openstack.templ
ates.OSConfigRenderer.complete_contexts which ultimately runs the __call__() function of the context object. We may be able to expand this somehow.

122. By David Ames

Updates to status_set

Revision history for this message
James Page (james-page) :
review: Needs Fixing
123. By David Ames

Set workload state waiting or blocked

124. By David Ames

Let the decorator set the status

125. By David Ames

Fix unit tests for new related(interface) check

Unmerged revisions

125. By David Ames

Fix unit tests for new related(interface) check

124. By David Ames

Let the decorator set the status

123. By David Ames

Set workload state waiting or blocked

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