From 29024cfdd5f131c7e3085cbddf9bd1cf60359960 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Wed, 28 Mar 2018 10:14:39 -0400 Subject: core/build/various: python3 compat, prepare for python2 -> python3 Note 1) we're not supposed to be using #!/usr/bin/env python, see https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Shebang_lines Note 2) we're also not supposed to be using "!/usr/bin/python, see https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Out The previous patch (https://review.gluster.org/19767) tried to do too much in one patch, so it was abandoned. This patch does two things: 1) minor cleanup of configure(.ac) to explicitly use python2 2) change all the shebang lines to #!/usr/bin/python2 and add them where they were missing based on warnings emitted during rpmbuild. In a follow-up patch python2 will eventually be changed to python3. Before that python2-isms (e.g. print, string.join(), etc.) need to be converted to python3. Some of those can be rewritten in version agnostic python. E.g. print statements become print() with "from __future_ import print_function". The python 2to3 utility will be used for some of those. Also Aravinda has given guidance in the comments to the first patch for changes. updates: #411 Change-Id: I471730962b2526022115a1fc33629fb078b74338 Signed-off-by: Kaleb S. KEITHLEY --- tests/bugs/distribute/overlap.py | 2 +- tests/bugs/nfs/socket-as-fifo.py | 2 +- tests/features/ipctest.py | 2 +- tests/utils/create-files.py | 2 +- tests/utils/getfattr.py | 2 +- tests/utils/gfid-access.py | 2 +- tests/utils/pidof.py | 2 +- tests/utils/setfattr.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/bugs/distribute/overlap.py b/tests/bugs/distribute/overlap.py index 15f2da473f1..253bb4052ec 100755 --- a/tests/bugs/distribute/overlap.py +++ b/tests/bugs/distribute/overlap.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 import sys diff --git a/tests/bugs/nfs/socket-as-fifo.py b/tests/bugs/nfs/socket-as-fifo.py index 1fce5b96896..da9886ea364 100755 --- a/tests/bugs/nfs/socket-as-fifo.py +++ b/tests/bugs/nfs/socket-as-fifo.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python2 # # Create a unix domain socket and test if it is a socket (and not a fifo/pipe). # diff --git a/tests/features/ipctest.py b/tests/features/ipctest.py index 93392486140..e89642f589b 100755 --- a/tests/features/ipctest.py +++ b/tests/features/ipctest.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 import ctypes diff --git a/tests/utils/create-files.py b/tests/utils/create-files.py index bef4201bf1f..71f967f4fdb 100755 --- a/tests/utils/create-files.py +++ b/tests/utils/create-files.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/python2 # This script was developed by Vijaykumar Koppad (vkoppad@redhat.com) # The latest version of this script can found at diff --git a/tests/utils/getfattr.py b/tests/utils/getfattr.py index 1a8369af7c4..6636644f67c 100755 --- a/tests/utils/getfattr.py +++ b/tests/utils/getfattr.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/python2 import os import sys diff --git a/tests/utils/gfid-access.py b/tests/utils/gfid-access.py index 81258073da1..4ca1665fec4 100755 --- a/tests/utils/gfid-access.py +++ b/tests/utils/gfid-access.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/python2 # # Copyright (c) 2011-2014 Red Hat, Inc. # This file is part of GlusterFS. diff --git a/tests/utils/pidof.py b/tests/utils/pidof.py index 575b899b6cc..01f2f0ad5bd 100755 --- a/tests/utils/pidof.py +++ b/tests/utils/pidof.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python2 import sys diff --git a/tests/utils/setfattr.py b/tests/utils/setfattr.py index d714d05edf3..159218d8bef 100755 --- a/tests/utils/setfattr.py +++ b/tests/utils/setfattr.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/python2 import os import sys -- cgit