Merge lp:~mthaddon/charm-haproxy/dict-value into lp:charm-haproxy

Proposed by Tom Haddon
Status: Merged
Approved by: Canonical IS Review Bot
Approved revision: 159
Merged at revision: 159
Proposed branch: lp:~mthaddon/charm-haproxy/dict-value
Merge into: lp:charm-haproxy
Diff against target: 12 lines (+1/-1)
1 file modified
hooks/hooks.py (+1/-1)
To merge this branch: bzr merge lp:~mthaddon/charm-haproxy/dict-value
Reviewer Review Type Date Requested Status
Canonical IS Review Bot Approve
Canonical IS Reviewers Pending
Review via email: mp+448242@code.launchpad.net

Commit message

Switch to a list rather than trying to sort, as doing so will fail with a TypeError for services_dict.

Description of the change

Switch to a list rather than trying to sort, as doing so will fail with a TypeError for services_dict.

The specific error we're seeing was https://paste.ubuntu.com/p/MqgM7Vd5xc/ and was caused by trying to compare two dict_value objects, which doesn't work in Python3. Just convert to a list instead.

To post a comment you must log in.
Revision history for this message
Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Canonical IS Review Bot (canonical-is-reviewbot) wrote :

Proxy approval for moon127

review: Approve
Revision history for this message
Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 159

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2023-07-21 14:38:32 +0000
3+++ hooks/hooks.py 2023-08-02 10:06:12 +0000
4@@ -1168,7 +1168,7 @@
5 all_services = ""
6 services_dict = create_services()
7 if services_dict is not None:
8- all_services = yaml.safe_dump(sorted(services_dict.values()))
9+ all_services = yaml.safe_dump(list(services_dict.values()))
10
11 relation_set(relation_id=rid, port=str(my_port),
12 hostname=my_host,

Subscribers

People subscribed via source and target branches

to all changes: