vici: Decode error messages in Python bindings

Otherwise we might end up with b'<errmsg>' in the output.
This commit is contained in:
Tobias Brunner
2021-01-18 17:39:15 +01:00
parent 414f2c3754
commit 2610cd7928
@@ -78,7 +78,7 @@ class Session(CommandWrappers, object):
if command_response["success"] != b"yes": if command_response["success"] != b"yes":
raise CommandException( raise CommandException(
"Command failed: {errmsg}".format( "Command failed: {errmsg}".format(
errmsg=command_response["errmsg"] errmsg=command_response["errmsg"].decode("UTF-8")
) )
) )
@@ -135,7 +135,7 @@ class Session(CommandWrappers, object):
if command_response["success"] != b"yes": if command_response["success"] != b"yes":
raise CommandException( raise CommandException(
"Command failed: {errmsg}".format( "Command failed: {errmsg}".format(
errmsg=command_response["errmsg"] errmsg=command_response["errmsg"].decode("UTF-8")
) )
) )