From 92f5248a072505315546a9d28f0c0739adb03e00 Mon Sep 17 00:00:00 2001 From: David Ames Date: Wed, 11 Apr 2018 14:19:29 -0700 Subject: [PATCH] Charm-helpers sync to fix CA cert comparison The comparison of bytes vs string of the CA certificate produces a false negative. This leads to rewriting certificates and affecting connectivity to services. Read in the certificate as bytes as well for a bytes vs bytes comparison. Closes-Bug: #1762431 Change-Id: Ic226149cc124ac5b84ab30d95a590f08489c67f2 --- charmhelpers/contrib/hahelpers/apache.py | 2 +- charmhelpers/fetch/ubuntu.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/charmhelpers/contrib/hahelpers/apache.py b/charmhelpers/contrib/hahelpers/apache.py index a8527047..605a1bec 100644 --- a/charmhelpers/contrib/hahelpers/apache.py +++ b/charmhelpers/contrib/hahelpers/apache.py @@ -77,7 +77,7 @@ def get_ca_cert(): def retrieve_ca_cert(cert_file): cert = None if os.path.isfile(cert_file): - with open(cert_file, 'r') as crt: + with open(cert_file, 'rb') as crt: cert = crt.read() return cert diff --git a/charmhelpers/fetch/ubuntu.py b/charmhelpers/fetch/ubuntu.py index 910e96a6..653d58f1 100644 --- a/charmhelpers/fetch/ubuntu.py +++ b/charmhelpers/fetch/ubuntu.py @@ -44,6 +44,7 @@ ARCH_TO_PROPOSED_POCKET = { 'x86_64': PROPOSED_POCKET, 'ppc64le': PROPOSED_PORTS_POCKET, 'aarch64': PROPOSED_PORTS_POCKET, + 's390x': PROPOSED_PORTS_POCKET, } CLOUD_ARCHIVE_URL = "http://ubuntu-cloud.archive.canonical.com/ubuntu" CLOUD_ARCHIVE_KEY_ID = '5EDB1B62EC4926EA'