on a xenial-queens ssl deployment (using the mojo specs) nova-cloud-controller fails with:
2018-10-29 08:28:14 DEBUG shared-db-relation-changed Traceback (most recent call last):
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/shared-db-relation-changed", line 1217, in <module>
2018-10-29 08:28:14 DEBUG shared-db-relation-changed main()
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/shared-db-relation-changed", line 1209, in main
2018-10-29 08:28:14 DEBUG shared-db-relation-changed hooks.execute(sys.argv)
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/charmhelpers/core/hookenv.py", line 848, in execute
2018-10-29 08:28:14 DEBUG shared-db-relation-changed self._hooks[hook_name]()
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/nova_cc_utils.py", line 1262, in wrapped_f
2018-10-29 08:28:14 DEBUG shared-db-relation-changed return f(*args, **kwargs)
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/charmhelpers/contrib/openstack/utils.py", line 1478, in wrapped_f
2018-10-29 08:28:14 DEBUG shared-db-relation-changed stopstart, restart_functions)
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/charmhelpers/core/host.py", line 730, in restart_on_change_helper
2018-10-29 08:28:14 DEBUG shared-db-relation-changed r = lambda_f()
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/charmhelpers/contrib/openstack/utils.py", line 1477, in <lambda>
2018-10-29 08:28:14 DEBUG shared-db-relation-changed (lambda: f(*args, **kwargs)), __restart_map_cache['cache'],
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/shared-db-relation-changed", line 397, in db_changed
2018-10-29 08:28:14 DEBUG shared-db-relation-changed leader_init_db_if_ready()
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/shared-db-relation-changed", line 121, in leader_init_db_if_ready
2018-10-29 08:28:14 DEBUG shared-db-relation-changed update_nova_relation(remote_restart=True)
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/shared-db-relation-changed", line 612, in update_nova_relation
2018-10-29 08:28:14 DEBUG shared-db-relation-changed compute_joined(rid=rid, remote_restart=remote_restart)
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/shared-db-relation-changed", line 622, in compute_joined
2018-10-29 08:28:14 DEBUG shared-db-relation-changed rel_settings.update(keystone_compute_settings())
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/shared-db-relation-changed", line 536, in keystone_compute_settings
2018-10-29 08:28:14 DEBUG shared-db-relation-changed ks_ca = ncc_utils.keystone_ca_cert_b64()
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/nova_cc_utils.py", line 907, in keystone_ca_cert_b64
2018-10-29 08:28:14 DEBUG shared-db-relation-changed return base64.b64encode(_in.read())
2018-10-29 08:28:14 DEBUG shared-db-relation-changed File "/usr/lib/python3.5/base64.py", line 59, in b64encode
2018-10-29 08:28:14 DEBUG shared-db-relation-changed encoded = binascii.b2a_base64(s)[:-1]
2018-10-29 08:28:14 DEBUG shared-db-relation-changed TypeError: a bytes-like object is required, not 'str'
Reviewed: https:/ /review. openstack. org/614145 /git.openstack. org/cgit/ openstack/ charm-nova- cloud-controlle r/commit/ ?id=f20ea273f95 f21ee1b59efd4db 9295dfce66fd02
Committed: https:/
Submitter: Zuul
Branch: master
commit f20ea273f95f21e e1b59efd4db9295 dfce66fd02
Author: Chris MacNaughton <email address hidden>
Date: Tue Oct 30 09:32:31 2018 +0100
Open file as binary to write bytes
Due to a change in the return types in the base64
decoded data, we should open these files in binary
mode to write the byte streams directly.
Change-Id: I9f88a71406b1e6 ea774fdbbeea4ba 447901fe5c2
Closes-Bug: #1800436