From 3b1d48d0bc01ea98060d923ccd4dae33480df027 Mon Sep 17 00:00:00 2001 From: tierno Date: Tue, 10 Dec 2019 13:01:55 +0000 Subject: [PATCH] fix 961 change ssh-keys from bytes to str Change-Id: I3a15417a84f0e0821dddd5d7b0617aa62ac531ac Signed-off-by: tierno --- RO/osm_ro/nfvo.py | 6 ++++++ RO/osm_ro/openmanod.cfg | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/RO/osm_ro/nfvo.py b/RO/osm_ro/nfvo.py index b48e260b..3f0b9d0e 100644 --- a/RO/osm_ro/nfvo.py +++ b/RO/osm_ro/nfvo.py @@ -5905,6 +5905,10 @@ def create_RO_keypair(tenant_id): private_key = key.exportKey(passphrase=tenant_id, pkcs=8) except (ValueError, NameError) as e: raise NfvoException("Unable to create private key: {}".format(e), httperrors.Internal_Server_Error) + if isinstance(public_key, bytes): + public_key = public_key.decode(encoding='UTF-8') + if isinstance(private_key, bytes): + private_key = private_key.decode(encoding='UTF-8') return public_key, private_key def decrypt_key (key, tenant_id): @@ -5921,6 +5925,8 @@ def decrypt_key (key, tenant_id): unencrypted_key = key.exportKey('PEM') if isinstance(unencrypted_key, ValueError): raise NfvoException("Unable to decrypt the private key: {}".format(unencrypted_key), httperrors.Internal_Server_Error) + if isinstance(unencrypted_key, bytes): + unencrypted_key = unencrypted_key.decode(encoding='UTF-8') except ValueError as e: raise NfvoException("Unable to decrypt the private key: {}".format(e), httperrors.Internal_Server_Error) return unencrypted_key diff --git a/RO/osm_ro/openmanod.cfg b/RO/osm_ro/openmanod.cfg index 3565bbfc..6e743da4 100644 --- a/RO/osm_ro/openmanod.cfg +++ b/RO/osm_ro/openmanod.cfg @@ -75,7 +75,7 @@ log_level_db: ERROR #database log levels #log_file_wim: /opt/openmano/logs/openmano_wimconn.log #log_level_nfvo: DEBUG #Main engine log levels #log_file_nfvo: /opt/openmano/logs/openmano_nfvo.log -#log_level_http: DEBUG #Main engine log levels +log_level_http: DEBUG #Main engine log levels #log_file_http: /opt/openmano/logs/openmano_http.log #log_level_console: DEBUG #proxy console log levels #log_file_console: /opt/openmano/logs/openmano_console.log -- 2.25.1