summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarty E. Plummer <hanetzer@startmail.com>2019-05-10 04:03:59 -0500
committerRAJA DAS <rajadas2@in.ibm.com>2020-01-09 23:05:50 -0600
commit629327db0795743615e1baeb5d6f007dec1cd99e (patch)
tree05ca4382aeab82d58f663dcaef9b6de99d0fe15b
parent26de8811a57f8b519453069a7d70c09359c7a56c (diff)
downloadtalos-sbe-629327db0795743615e1baeb5d6f007dec1cd99e.tar.gz
talos-sbe-629327db0795743615e1baeb5d6f007dec1cd99e.zip
updateBuildTag: convert proc.stdout.read() to str.
In python2.7, proc.stdout.read() returns a str type. On python3.x, it returns bytes. Without this change, building with python3.x (python3.5 tested) as /usr/bin/python will result in the following error: Traceback (most recent call last): File "./updateBuildTag.py", line 76, in <module> updateBuildTag(sys.argv) File "./updateBuildTag.py", line 62, in updateBuildTag cmd_build_tag = cmd_build_tag+" "+commit_id TypeError: Can't convert 'bytes' object to str implicitly Change-Id: Ib53e0012dd32883559c5fb9d82beb6f2d8881921 Signed-off-by: Marty E. Plummer <hanetzer@startmail.com> Signed-off-by: vinaybs6 <vinaybs6@in.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/89363 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Srikantha S. Meesala <srikantha@in.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
-rwxr-xr-xsrc/build/updateBuildTag.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/build/updateBuildTag.py b/src/build/updateBuildTag.py
index 6a49c8ce..8d342d78 100755
--- a/src/build/updateBuildTag.py
+++ b/src/build/updateBuildTag.py
@@ -51,14 +51,14 @@ def updateBuildTag(argv):
tag_exist_cmd = "git log | grep \"Release notes for sbe\"| awk '{ print $NF }'"
proc = subprocess.Popen(tag_exist_cmd, shell=True, stdout=subprocess.PIPE)
- build_tag = proc.stdout.read()
+ build_tag = str(proc.stdout.read())
if ( build_tag ):
cmd_build_tag = cmd_build_tag+" "+build_tag
else:
commit_id_cmd = "git log |grep commit -m1 |awk '{ print $NF }' |awk '{print substr ($0, 0, 17)}'"
proc = subprocess.Popen(commit_id_cmd, shell=True, stdout=subprocess.PIPE)
- commit_id = proc.stdout.read()
+ commit_id = str(proc.stdout.read())
cmd_build_tag = cmd_build_tag+" "+commit_id
proc = subprocess.Popen(cmd_build_tag, shell=True, stdout=subprocess.PIPE)
@@ -68,7 +68,7 @@ def updateBuildTag(argv):
proc = subprocess.Popen(cmd_build_time, shell=True, stdout=subprocess.PIPE)
cmd_temp = "id -un"
proc = subprocess.Popen(cmd_temp, shell=True, stdout=subprocess.PIPE)
- cmd_build_user = cmd_build_user+" "+proc.stdout.read()
+ cmd_build_user = cmd_build_user+" "+str(proc.stdout.read())
proc = subprocess.Popen(cmd_build_user, shell=True, stdout=subprocess.PIPE)
cmd_build_host = cmd_build_host+" "+socket.gethostname()
proc = subprocess.Popen(cmd_build_host, shell=True, stdout=subprocess.PIPE)
OpenPOWER on IntegriCloud