Merge lp:~thedac/charm-helpers/no-dup-status into lp:charm-helpers

Proposed by David Ames
Status: Merged
Merged at revision: 468
Proposed branch: lp:~thedac/charm-helpers/no-dup-status
Merge into: lp:charm-helpers
Diff against target: 13 lines (+3/-1)
1 file modified
charmhelpers/contrib/openstack/utils.py (+3/-1)
To merge this branch: bzr merge lp:~thedac/charm-helpers/no-dup-status
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+274470@code.launchpad.net

Description of the change

Because our set_os_workload_status call back function often runs set_os_workload_status recursively we get duplicate messages like the following:

 Incomplete relations: identity, database Incomplete relations: storage-backend

http://paste.ubuntu.com/12776966/

In this context, we will only ever get "Incomplete relations" as a duplicate. This MP simply removes the duplicate.

To post a comment you must log in.
Revision history for this message
Liam Young (gnuoy) wrote :

Approce

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/openstack/utils.py'
2--- charmhelpers/contrib/openstack/utils.py 2015-10-10 21:29:15 +0000
3+++ charmhelpers/contrib/openstack/utils.py 2015-10-14 21:35:31 +0000
4@@ -859,7 +859,9 @@
5 if charm_state != 'active' and charm_state != 'unknown':
6 state = workload_state_compare(state, charm_state)
7 if message:
8- message = "{} {}".format(message, charm_message)
9+ charm_message = charm_message.replace("Incomplete relations: ",
10+ "")
11+ message = "{}, {}".format(message, charm_message)
12 else:
13 message = charm_message
14

Subscribers

People subscribed via source and target branches