Revert "Use six.text_type rather than str.encode" 74/15874/2
authorAnil Belur <abelur@linuxfoundation.org>
Wed, 12 Jun 2019 23:54:24 +0000 (09:54 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 13 Jun 2019 00:15:43 +0000 (10:15 +1000)
This reverts commit e99dca16eef12f2e09c7911cc145ed637f9584bc.

The change was tested with ODL merge job and does not work.
Reverting this until we have this properly tested with the
jobs.

Change-Id: If1382188753ff590c767ce4ab5770f2c271fda69
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
lftools/deploy.py
releasenotes/notes/no-encode-py3-44307e6fd97c2d0c.yaml [deleted file]

index 00214c6..93a77a7 100644 (file)
@@ -28,7 +28,6 @@ import zipfile
 from defusedxml.minidom import parseString
 import glob2  # Switch to glob when Python < 3.5 support is dropped
 import requests
-import six
 
 log = logging.getLogger(__name__)
 
@@ -310,11 +309,11 @@ def deploy_logs(nexus_url, nexus_path, build_url):
 
     resp = requests.get('{}/consoleText'.format(_format_url(build_url)))
     with open('console.log', 'w+') as f:
-        f.write(str(six.text_type(resp.text.split(MAGIC_STRING)[0])))
+        f.write(str(resp.text.split(MAGIC_STRING)[0].encode('utf-8')))
 
     resp = requests.get('{}/timestamps?time=HH:mm:ss&appendLog'.format(_format_url(build_url)))
     with open('console-timestamp.log', 'w+') as f:
-        f.write(str(six.text_type(resp.text.split(MAGIC_STRING)[0])))
+        f.write(str(resp.text.split(MAGIC_STRING)[0].encode('utf-8')))
 
     _compress_text(work_dir)
 
diff --git a/releasenotes/notes/no-encode-py3-44307e6fd97c2d0c.yaml b/releasenotes/notes/no-encode-py3-44307e6fd97c2d0c.yaml
deleted file mode 100644 (file)
index 4c9f2aa..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
----
-fixes:
-  - |
-    Use six.text_type() rather than str.encode('utf-8') in deploy_logs, so that
-    strings are no longer rewritten as bytes objects in Python 3.