Encode pubkey in validators
Follow up change for py2->py3 migration. The pubkey must be encoded in order to avoid 'data must be bytes-like' error. The key is a type of str which in py2 meant bytes, however, in py3 it's just string. Therefore the pubkey must be encoded before it's passed to load_ssh_public_key which requires bytes-like data. Change-Id: I943438a59923bd9c4e9dd38058020e49fd2f3d24
This commit is contained in:
parent
bbbe1f525b
commit
06207cfb93
@ -127,7 +127,7 @@ class TestResultValidator(BaseValidator):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
key = load_ssh_public_key(
|
key = load_ssh_public_key(
|
||||||
request.headers.get('X-Public-Key', ''),
|
request.headers.get('X-Public-Key', '').encode('utf-8'),
|
||||||
backend=backends.default_backend()
|
backend=backends.default_backend()
|
||||||
)
|
)
|
||||||
except (binascii.Error, ValueError) as e:
|
except (binascii.Error, ValueError) as e:
|
||||||
|
Loading…
Reference in New Issue
Block a user