Merge lp:~mthaddon/charm-haproxy/errorfile-bytemode into lp:charm-haproxy

Proposed by Tom Haddon
Status: Merged
Approved by: Barry Price
Approved revision: 162
Merged at revision: 163
Proposed branch: lp:~mthaddon/charm-haproxy/errorfile-bytemode
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/errorfile-bytemode
Reviewer Review Type Date Requested Status
Barry Price Approve
Canonical IS Reviewers Pending
Review via email: mp+450211@code.launchpad.net

Commit message

base64.b64decode returns bytes rather than a string, so open the errorfile we'll write to in byte mode

Description of the change

base64.b64decode returns bytes rather than a string, so open the errorfile we'll write to in byte mode

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
Barry Price (barryprice) wrote :

+1

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

Change successfully merged at revision 163

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-08-23 11:41:20 +0000
3+++ hooks/hooks.py 2023-08-30 07:09:33 +0000
4@@ -832,7 +832,7 @@
5 path = get_service_lib_path(service_name)
6 full_path = os.path.join(
7 path, "%s.http" % errorfile["http_status"])
8- with open(full_path, 'w') as f:
9+ with open(full_path, 'wb') as f:
10 f.write(base64.b64decode(errorfile["content"]))
11
12 # Write to disk the content of the given SSL certificates

Subscribers

People subscribed via source and target branches

to all changes: