Rabbit SSL CA should be opened for reading bytes

The file is subsequently encoded as base64, which requires a
bytes-like object, not a str

Change-Id: I3d53fe98caaf1728f1d0c67de2c4a5e53deafa0e
Closes-Bug: #1834215
This commit is contained in:
Chris MacNaughton 2019-06-27 07:54:49 +02:00
parent 7cc006d262
commit 3b255326e4
1 changed files with 1 additions and 1 deletions

View File

@ -427,7 +427,7 @@ def ceilometer_joined():
# This value gets tranformed to a path by the context we need to
# pass the data to agents.
if 'rabbit_ssl_ca' in context:
with open(context['rabbit_ssl_ca'], 'rt') as fh:
with open(context['rabbit_ssl_ca'], 'rb') as fh:
context['rabbit_ssl_ca'] = base64.b64encode(fh.read())
for relid in relation_ids('ceilometer-service'):
relation_set(relid, context)