When installing CA certificates using the dcorch proxy, an error
occurred because the certificate data was being handled as bytes
instead of a string. This caused a serialization error when
processing the request.
Now the certificate payload is always converted to a UTF-8 string
before sending it to the next step, preventing this problem.
Additionally, when parsing multipart form data in
_decode_certificate_payload, the fields from each part are also
decoded from UTF-8 to string. This guarantees all data handled
downstream is in string format and compatible with JSON serialization.
Test Plan:
- PASS: Install a CA certificate via dcorch-proxy using
"--os-region-name SystemController". Verify that the orchjob is
created correctly and that the certificate is installed immediately
in the subcloud.
- PASS: Uninstall a CA certificate via dcorch-proxy. Verify that the
certificate is uninstalled from the subcloud immediately.
- PASS: Install a CA certificate without dcorch proxy and wait until
the audit job detects it. Verify the certificate is installed in
the subcloud.
- PASS: Unmanage the subcloud and install a certificate with the same
CN on both the system controller and the subcloud. Verify that
the certificate is in sync after managing the subcloud again.
Closes-bug: 2113779
Change-Id: If4b1ea17434bd4a999ed7af06ffd0a2364f36a97
Signed-off-by: Enzo Candotti <Enzo.Candotti@windriver.com>