Skip to content

Commit 629327d

Browse files
hanetzerRAJA DAS
authored andcommitted
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>
1 parent 26de881 commit 629327d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/build/updateBuildTag.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ def updateBuildTag(argv):
5151

5252
tag_exist_cmd = "git log | grep \"Release notes for sbe\"| awk '{ print $NF }'"
5353
proc = subprocess.Popen(tag_exist_cmd, shell=True, stdout=subprocess.PIPE)
54-
build_tag = proc.stdout.read()
54+
build_tag = str(proc.stdout.read())
5555
if ( build_tag ):
5656
cmd_build_tag = cmd_build_tag+" "+build_tag
5757

5858
else:
5959
commit_id_cmd = "git log |grep commit -m1 |awk '{ print $NF }' |awk '{print substr ($0, 0, 17)}'"
6060
proc = subprocess.Popen(commit_id_cmd, shell=True, stdout=subprocess.PIPE)
61-
commit_id = proc.stdout.read()
61+
commit_id = str(proc.stdout.read())
6262
cmd_build_tag = cmd_build_tag+" "+commit_id
6363

6464
proc = subprocess.Popen(cmd_build_tag, shell=True, stdout=subprocess.PIPE)
@@ -68,7 +68,7 @@ def updateBuildTag(argv):
6868
proc = subprocess.Popen(cmd_build_time, shell=True, stdout=subprocess.PIPE)
6969
cmd_temp = "id -un"
7070
proc = subprocess.Popen(cmd_temp, shell=True, stdout=subprocess.PIPE)
71-
cmd_build_user = cmd_build_user+" "+proc.stdout.read()
71+
cmd_build_user = cmd_build_user+" "+str(proc.stdout.read())
7272
proc = subprocess.Popen(cmd_build_user, shell=True, stdout=subprocess.PIPE)
7373
cmd_build_host = cmd_build_host+" "+socket.gethostname()
7474
proc = subprocess.Popen(cmd_build_host, shell=True, stdout=subprocess.PIPE)

0 commit comments

Comments
 (0)