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 --- tools/glusterfind/S57glusterfind-delete-post.py | 2 +- tools/glusterfind/glusterfind.in | 2 +- tools/glusterfind/src/brickfind.py | 2 +- tools/glusterfind/src/changelog.py | 2 +- tools/glusterfind/src/main.py | 2 +- tools/glusterfind/src/nodeagent.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tools/glusterfind') diff --git a/tools/glusterfind/S57glusterfind-delete-post.py b/tools/glusterfind/S57glusterfind-delete-post.py index fb6c222df03..662ef460bec 100755 --- a/tools/glusterfind/S57glusterfind-delete-post.py +++ b/tools/glusterfind/S57glusterfind-delete-post.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 import os import shutil from errno import ENOENT diff --git a/tools/glusterfind/glusterfind.in b/tools/glusterfind/glusterfind.in index cff8973980a..3af04d46539 100644 --- a/tools/glusterfind/glusterfind.in +++ b/tools/glusterfind/glusterfind.in @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python2 # Copyright (c) 2015 Red Hat, Inc. # This file is part of GlusterFS. diff --git a/tools/glusterfind/src/brickfind.py b/tools/glusterfind/src/brickfind.py index e914bacd4ab..6b430d3b9d2 100644 --- a/tools/glusterfind/src/brickfind.py +++ b/tools/glusterfind/src/brickfind.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python2 # -*- coding: utf-8 -*- # Copyright (c) 2015 Red Hat, Inc. diff --git a/tools/glusterfind/src/changelog.py b/tools/glusterfind/src/changelog.py index 2376af26e72..b124ae7e168 100644 --- a/tools/glusterfind/src/changelog.py +++ b/tools/glusterfind/src/changelog.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python2 # -*- coding: utf-8 -*- # Copyright (c) 2015 Red Hat, Inc. diff --git a/tools/glusterfind/src/main.py b/tools/glusterfind/src/main.py index 63de6d06410..3e7a729338c 100644 --- a/tools/glusterfind/src/main.py +++ b/tools/glusterfind/src/main.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python2 # -*- coding: utf-8 -*- # Copyright (c) 2015 Red Hat, Inc. diff --git a/tools/glusterfind/src/nodeagent.py b/tools/glusterfind/src/nodeagent.py index 07d82826e0d..e921bc0df43 100644 --- a/tools/glusterfind/src/nodeagent.py +++ b/tools/glusterfind/src/nodeagent.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python2 # -*- coding: utf-8 -*- # Copyright (c) 2015 Red Hat, Inc. -- cgit