Skip to content

Commit

Permalink
Fix base64 encoding (#302)
Browse files Browse the repository at this point in the history
* Fix base64 encoding issues (binary string - regular string)
* Update version and History
* PR feedback
  • Loading branch information
montgomp authored Jan 27, 2021
1 parent fd5c049 commit 5e6416d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
Release History
===============

0.10.9
+++++++++++++++

**Azure IoT Product Certification service**

* Fix bug for `az iot product test create` sending a byte string instead of "regular" base64 string.

0.10.8
+++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion azext_iot/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import os

VERSION = "0.10.8"
VERSION = "0.10.9"
EXTENSION_NAME = "azure-iot"
EXTENSION_ROOT = os.path.dirname(os.path.abspath(__file__))
EXTENSION_CONFIG_ROOT_KEY = "iotext"
Expand Down
5 changes: 2 additions & 3 deletions azext_iot/product/test/command_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,8 @@ def _read_certificate_from_file(certificate_path):
with open(file=certificate_path, mode="rb") as f:
data = f.read()

from base64 import encodestring # pylint: disable=no-name-in-module

return encodestring(data)
from base64 import b64encode # pylint: disable=no-name-in-module
return b64encode(data).decode('utf-8')


def _create_from_file(configuration_file):
Expand Down

0 comments on commit 5e6416d

Please sign in to comment.