summaryrefslogtreecommitdiffstats
path: root/robotframework-onap/ONAPLibrary/RequestsHelper.py
diff options
context:
space:
mode:
authorDR695H <dr695h@att.com>2019-08-26 17:20:30 -0400
committerDR695H <dr695h@att.com>2019-08-26 17:33:37 -0400
commit566c583bbfe0b5a4e46af7ac53765a1340d11fc0 (patch)
tree2517b7117625794533fbf006e21fb2f69316c353 /robotframework-onap/ONAPLibrary/RequestsHelper.py
parentb7ca10dbbff71b69683751b2ba5c3da6cd44f80b (diff)
improved unicode encoding for the string in py2 and py3
Issue-ID: TEST-184 Signed-off-by: DR695H <dr695h@att.com> Change-Id: I3f6bd36fd5be7b4c143696adf6bb8f9d5f69ebc7
Diffstat (limited to 'robotframework-onap/ONAPLibrary/RequestsHelper.py')
-rw-r--r--robotframework-onap/ONAPLibrary/RequestsHelper.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/robotframework-onap/ONAPLibrary/RequestsHelper.py b/robotframework-onap/ONAPLibrary/RequestsHelper.py
index f3a0ad5..ec0ef2d 100644
--- a/robotframework-onap/ONAPLibrary/RequestsHelper.py
+++ b/robotframework-onap/ONAPLibrary/RequestsHelper.py
@@ -90,9 +90,12 @@ class RequestsHelper(object):
@staticmethod
def _format_md5(md5_input):
- if md5_input is not None and isinstance(md5_input, str):
+ string_input = md5_input
+ if md5_input is not None:
+ if isinstance(md5_input, str):
+ string_input = md5_input.encode('utf-8')
md5 = hashlib.md5()
- md5.update(md5_input.encode('utf-8'))
+ md5.update(string_input)
return Base64Keywords().base64_encode(md5.hexdigest())
else:
return None