Fix template issue with user_data_config_drive
Fix a python3 error that prevented to use the user_data_config_drive option when building amphorae. user_data_config_drive has been broken since we switched to python3, a mix of str and bytes variables were provided to the jinja2 templates. This commit ensures that the type of all the certificates provided to jinja2 are strings. Story: 2005553 Task: 30705 Change-Id: I53ed0425f00cfbbc964f5083b4f2942cf5bf565e
This commit is contained in:
parent
27e5b27d31
commit
64d8d991f1
@ -165,7 +165,8 @@ class CertComputeCreate(ComputeCreate):
|
||||
key = utils.get_compatible_server_certs_key_passphrase()
|
||||
fer = fernet.Fernet(key)
|
||||
config_drive_files = {
|
||||
'/etc/octavia/certs/server.pem': fer.decrypt(server_pem),
|
||||
'/etc/octavia/certs/server.pem': fer.decrypt(
|
||||
server_pem).decode('utf-8'),
|
||||
'/etc/octavia/certs/client_ca.pem': ca}
|
||||
return super().execute(
|
||||
amphora_id, config_drive_files=config_drive_files,
|
||||
|
@ -173,7 +173,7 @@ class CertComputeCreate(ComputeCreate):
|
||||
fer = fernet.Fernet(key)
|
||||
config_drive_files = {
|
||||
'/etc/octavia/certs/server.pem': fer.decrypt(
|
||||
server_pem.encode("utf-8")),
|
||||
server_pem.encode("utf-8")).decode("utf-8"),
|
||||
'/etc/octavia/certs/client_ca.pem': ca}
|
||||
return super().execute(
|
||||
amphora_id, config_drive_files=config_drive_files,
|
||||
|
@ -378,7 +378,8 @@ class TestComputeTasks(base.TestCase):
|
||||
user_data=None,
|
||||
config_drive_files={
|
||||
'/etc/rsyslog.d/10-rsyslog.conf': 'FAKE CFG',
|
||||
'/etc/octavia/certs/server.pem': fer.decrypt(test_cert),
|
||||
'/etc/octavia/certs/server.pem': fer.decrypt(
|
||||
test_cert).decode('utf-8'),
|
||||
'/etc/octavia/certs/client_ca.pem': 'test',
|
||||
'/etc/octavia/amphora-agent.conf': 'test_conf'},
|
||||
server_group_id=SERVER_GRPOUP_ID,
|
||||
|
@ -391,7 +391,7 @@ class TestComputeTasks(base.TestCase):
|
||||
config_drive_files={
|
||||
'/etc/rsyslog.d/10-rsyslog.conf': 'FAKE CFG',
|
||||
'/etc/octavia/certs/server.pem': fer.decrypt(
|
||||
test_cert.encode('utf-8')),
|
||||
test_cert.encode('utf-8')).decode('utf-8'),
|
||||
'/etc/octavia/certs/client_ca.pem': 'test',
|
||||
'/etc/octavia/amphora-agent.conf': 'test_conf'},
|
||||
server_group_id=SERVER_GRPOUP_ID,
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fix a python3 error that prevented to use the
|
||||
``[controller_worker]/user_data_config_drive`` option when building
|
||||
amphorae.
|
Loading…
Reference in New Issue
Block a user