diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2018-12-03 13:38:37 -0500 |
---|---|---|
committer | Parker Berberian <pberberian@iol.unh.edu> | 2018-12-03 13:38:37 -0500 |
commit | 259a327639c5e32e15ccce34c013eece72cd175c (patch) | |
tree | 0ced0c4954769603e5a68ab32d4ab630342e7238 | |
parent | b02aa2535c7b7beacbc2d7d24d8522fa596afeee (diff) |
BUG FIX: Properly decodes ssh public keyfile
Because of how Python3 changed how it handled strings,
the byte string read from the user's keyfile was not directly
serializable. This decodes the bytes into a unicode string, assuming UTF-8 encoding.
Change-Id: I5f723a61fb577fa6d4e76e701ef529521ab389ba
Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
-rw-r--r-- | dashboard/src/api/admin.py | 2 | ||||
-rw-r--r-- | dashboard/src/api/models.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/dashboard/src/api/admin.py b/dashboard/src/api/admin.py index 3d32c78..8b2fcb3 100644 --- a/dashboard/src/api/admin.py +++ b/dashboard/src/api/admin.py @@ -17,6 +17,7 @@ from api.models import ( HardwareConfig, NetworkConfig, SoftwareConfig, + AccessConfig, AccessRelation, SoftwareRelation, HostHardwareRelation, @@ -33,6 +34,7 @@ admin.site.register(OpnfvApiConfig) admin.site.register(HardwareConfig) admin.site.register(NetworkConfig) admin.site.register(SoftwareConfig) +admin.site.register(AccessConfig) admin.site.register(AccessRelation) admin.site.register(SoftwareRelation) admin.site.register(HostHardwareRelation) diff --git a/dashboard/src/api/models.py b/dashboard/src/api/models.py index 78ec920..b6bd79f 100644 --- a/dashboard/src/api/models.py +++ b/dashboard/src/api/models.py @@ -652,7 +652,7 @@ class JobFactory(object): revoke=False, job=job, context={ - "key": user.userprofile.ssh_public_key.read(), + "key": user.userprofile.ssh_public_key.open().read().decode(encoding="UTF-8"), "hosts": [host.labid for host in hosts] } ) |