[SSSD] [PATCH] Use python2 in shebang for python scripts.

Lukas Slebodnik lslebodn at redhat.com
Fri Jun 6 14:55:55 UTC 2014


On (06/06/14 15:58), Lukas Slebodnik wrote:
>On (06/06/14 15:37), Sumit Bose wrote:
>>On Fri, Jun 06, 2014 at 03:01:55PM +0200, Lukas Slebodnik wrote:
>>> ehlo,
>>> 
>>> A user reported problem with the sss_obfuscate script on sssd-users mailing
>>> list[1]. The problem was that default version of python was not python 2.x.
>>> 
>>> We have a ticket fot python 3 support https://fedorahosted.org/sssd/ticket/2017
>>> Meanwhile, we should have python2 in shebang.
>>
>>I think it is a good idea to get some interim fix, but are you sure that
>>python2 is always available?
>>
>I tested few distributions (rhel{5,6,7} fedora20 debian7 ubuntu14.04)
>and python2 was symling either to python or directly to python{2.4, 2.6, 2.7}
>
>Output from my machine:
>
>sh-4.2$ file /usr/bin/python* | grep -v "\-config"
>/usr/bin/python:              symbolic link to `python2'
>/usr/bin/python2:             symbolic link to `python2.7'
>/usr/bin/python2.7:           ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=c1ba1105c6afac0aef79c52433cf491afbcfa57a, stripped
>/usr/bin/python3:             symbolic link to `python3.3'
>/usr/bin/python3.3:           ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=bb0a9af774944500709b9a0dd273ae42bffc978b, stripped
>/usr/bin/python3.3m:          ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=bb0a9af774944500709b9a0dd273ae42bffc978b, stripped
>
Resending with ticket url in commit message.

LS
-------------- next part --------------
>From 59c538d964a38617b88587c0c5bbdba161f4056c Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Fri, 6 Jun 2014 14:51:43 +0200
Subject: [PATCH] Use python2 in shebang for python scripts.

The python scripts are not tested with python3 and /usr/bin/python can be
symbolic link to python3 on some distributions.

Resolves:
https://fedorahosted.org/sssd/ticket/2356
---
 src/config/SSSDConfigTest.py   | 2 +-
 src/sbus/sbus_codegen          | 2 +-
 src/tests/pyhbac-test.py       | 2 +-
 src/tests/pysss_murmur-test.py | 2 +-
 src/tests/python-test.py       | 2 +-
 src/tools/sss_obfuscate        | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/config/SSSDConfigTest.py b/src/config/SSSDConfigTest.py
index d4ed06ae85f23debb7a715eee5f338de8aad466c..14500031beca7b621eb6a77011e1a48fa22c2f9a 100755
--- a/src/config/SSSDConfigTest.py
+++ b/src/config/SSSDConfigTest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
 '''
 Created on Sep 18, 2009
 
diff --git a/src/sbus/sbus_codegen b/src/sbus/sbus_codegen
index 15a6cadacc62e6809a9c807d30a48d6689ec0fd5..b4e63f33e6e5ef9fb56646142a29c97d35ca3ebf 100755
--- a/src/sbus/sbus_codegen
+++ b/src/sbus/sbus_codegen
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
 
 #
 # Authors:
diff --git a/src/tests/pyhbac-test.py b/src/tests/pyhbac-test.py
index 5579180b0da764df3ff57b2a014dee4d211c6974..c4228368a27741eff568b1a2858d7be072d9fef6 100755
--- a/src/tests/pyhbac-test.py
+++ b/src/tests/pyhbac-test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
 
 import unittest
 import sys
diff --git a/src/tests/pysss_murmur-test.py b/src/tests/pysss_murmur-test.py
index 715ea16b3814c7606fad127413cef18ae3711fa9..ee0e8b8a0fdef9e6ab825c7fc5f2fe661ec669ea 100755
--- a/src/tests/pysss_murmur-test.py
+++ b/src/tests/pysss_murmur-test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
 #  SSSD
 #
 #  Unit tests for pysss_murmur
diff --git a/src/tests/python-test.py b/src/tests/python-test.py
index e1eaab2d135bfb4e9eac063f80ad8852df8ca3ef..81e09c4bb96fb710e9e5fbcca051fc2c0581fc60 100644
--- a/src/tests/python-test.py
+++ b/src/tests/python-test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
 #coding=utf-8
 
 # Authors:
diff --git a/src/tools/sss_obfuscate b/src/tools/sss_obfuscate
index fbea1213d8f7e99ab3b1a6d7d24accf8a6194094..86e7daa1f626c76bdd54f5a4a37bde35b32eba1f 100644
--- a/src/tools/sss_obfuscate
+++ b/src/tools/sss_obfuscate
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
 
 import sys
 from optparse import OptionParser
-- 
1.9.3



More information about the sssd-devel mailing list