From 994179cd404e1cc366e2a84ddcaed24cd7948bd8 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Wed, 27 Mar 2019 15:33:41 +0000 Subject: [PATCH] Fix py3 issue with writing a file from base64 output Change-Id: Ifcfbce588f077f2664400b9f3e27c7b42176ca24 --- hooks/ceilometer_contexts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/ceilometer_contexts.py b/hooks/ceilometer_contexts.py index e83dacd..ee3d13c 100644 --- a/hooks/ceilometer_contexts.py +++ b/hooks/ceilometer_contexts.py @@ -78,7 +78,7 @@ class CeilometerServiceContext(OSContextGenerator): if conf.get('rabbit_ssl_ca') is not None: ca_path = os.path.join( self.ssl_dir, 'rabbit-client-ca.pem') - with open(ca_path, 'wt') as fh: + with open(ca_path, 'wb') as fh: fh.write(base64.b64decode(conf['rabbit_ssl_ca'])) conf['rabbit_ssl_ca'] = ca_path return conf