diff --git a/tripleo_common/actions/deployment.py b/tripleo_common/actions/deployment.py index cb370e25b..9a1988601 100644 --- a/tripleo_common/actions/deployment.py +++ b/tripleo_common/actions/deployment.py @@ -240,7 +240,7 @@ class DeployStackAction(templates.ProcessTemplatesAction): # CA to be trusted by the overcloud. try: with open(local_ca_path, 'rb') as ca_file: - return ca_file.read() + return ca_file.read().decode('utf-8') except IOError: # If the file wasn't found it means that the undercloud's TLS # was explicitly disabled or another CA is being used. So we'll diff --git a/tripleo_common/tests/actions/test_deployment.py b/tripleo_common/tests/actions/test_deployment.py index e58ee1e31..41000ee2c 100644 --- a/tripleo_common/tests/actions/test_deployment.py +++ b/tripleo_common/tests/actions/test_deployment.py @@ -482,7 +482,7 @@ class DeployStackActionTest(base.TestCase): self.assertIn('CAMap', my_params) self.assertIn('undercloud-ca', my_params['CAMap']) self.assertIn('content', my_params['CAMap']['undercloud-ca']) - self.assertEqual(b'FAKE CA CERT', + self.assertEqual('FAKE CA CERT', my_params['CAMap']['undercloud-ca']['content']) def test_set_tls_parameters_ca_found_camap_provided(self): @@ -491,7 +491,7 @@ class DeployStackActionTest(base.TestCase): my_params = {} my_env = { 'parameter_defaults': { - 'CAMap': {'overcloud-ca': {'content': b'ANOTER FAKE CERT'}}}} + 'CAMap': {'overcloud-ca': {'content': 'ANOTER FAKE CERT'}}}} with tempfile.NamedTemporaryFile() as ca_file: # Write test data ca_file.write(b'FAKE CA CERT') @@ -503,11 +503,11 @@ class DeployStackActionTest(base.TestCase): self.assertIn('CAMap', my_params) self.assertIn('undercloud-ca', my_params['CAMap']) self.assertIn('content', my_params['CAMap']['undercloud-ca']) - self.assertEqual(b'FAKE CA CERT', + self.assertEqual('FAKE CA CERT', my_params['CAMap']['undercloud-ca']['content']) self.assertIn('overcloud-ca', my_params['CAMap']) self.assertIn('content', my_params['CAMap']['overcloud-ca']) - self.assertEqual(b'ANOTER FAKE CERT', + self.assertEqual('ANOTER FAKE CERT', my_params['CAMap']['overcloud-ca']['content']) diff --git a/tripleo_common/utils/passwords.py b/tripleo_common/utils/passwords.py index 410a7adfb..d9d45520b 100644 --- a/tripleo_common/utils/passwords.py +++ b/tripleo_common/utils/passwords.py @@ -110,7 +110,7 @@ def create_cephx_key(): # https://github.com/ceph/ceph-deploy/blob/master/ceph_deploy/new.py#L21 key = os.urandom(16) header = struct.pack("