Blob Blame History Raw
From f355d4902890e5b4db15b87903a299697764bc8a Mon Sep 17 00:00:00 2001
From: Honggang Li <honli@redhat.com>
Date: Fri, 8 Feb 2019 21:26:39 -0500
Subject: [PATCH] Fix shebang for python scripts

rhel-8 does not support python2. User '#!/usr/bin/python3' for all
python scripts which with a shebang.

The substitution was done with following bash script.

====

pys=$(find . -type f -name '*.py')

for f in $pys; do
	sed -ne '1p' $f | grep -q -E '^#!/usr/bin'
	if [ $? -eq 0 ]; then
		echo $f
		sed -e '/^#!\/usr\/bin/d' -i $f
		sed -e '1 i\#!/usr/bin/python3' -i $f
	fi
done
===

Signed-off-by: Honggang Li <honli@redhat.com>
---
 mtcr_py/test.py                                         | 2 +-
 small_utils/mlxfwresetlib/mcra.py                       | 2 +-
 small_utils/mlxfwresetlib/mlnx_peripheral_components.py | 2 +-
 small_utils/mlxfwresetlib/mlxfwreset_mlnxdriver.py      | 2 +-
 small_utils/mlxfwresetlib/mlxfwreset_status_checker.py  | 2 +-
 small_utils/mlxfwresetlib/mlxfwreset_utils.py           | 2 +-
 small_utils/mlxfwresetlib/pci_device.py                 | 2 +-
 small_utils/mstfwreset.py                               | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/mtcr_py/test.py b/mtcr_py/test.py
index 74c5d28..1e44232 100755
--- a/mtcr_py/test.py
+++ b/mtcr_py/test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 # Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
 #
 # This software is available to you under a choice of one of two
diff --git a/small_utils/mlxfwresetlib/mcra.py b/small_utils/mlxfwresetlib/mcra.py
index 2144d43..bc44356 100644
--- a/small_utils/mlxfwresetlib/mcra.py
+++ b/small_utils/mlxfwresetlib/mcra.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
 #
diff --git a/small_utils/mlxfwresetlib/mlnx_peripheral_components.py b/small_utils/mlxfwresetlib/mlnx_peripheral_components.py
index 0ddf8d9..469e24b 100644
--- a/small_utils/mlxfwresetlib/mlnx_peripheral_components.py
+++ b/small_utils/mlxfwresetlib/mlnx_peripheral_components.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
 #
diff --git a/small_utils/mlxfwresetlib/mlxfwreset_mlnxdriver.py b/small_utils/mlxfwresetlib/mlxfwreset_mlnxdriver.py
index 4971b00..1f34925 100755
--- a/small_utils/mlxfwresetlib/mlxfwreset_mlnxdriver.py
+++ b/small_utils/mlxfwresetlib/mlxfwreset_mlnxdriver.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
 #
diff --git a/small_utils/mlxfwresetlib/mlxfwreset_status_checker.py b/small_utils/mlxfwresetlib/mlxfwreset_status_checker.py
index 1d614ac..153c87b 100755
--- a/small_utils/mlxfwresetlib/mlxfwreset_status_checker.py
+++ b/small_utils/mlxfwresetlib/mlxfwreset_status_checker.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
 #
diff --git a/small_utils/mlxfwresetlib/mlxfwreset_utils.py b/small_utils/mlxfwresetlib/mlxfwreset_utils.py
index 9b07328..2c64044 100755
--- a/small_utils/mlxfwresetlib/mlxfwreset_utils.py
+++ b/small_utils/mlxfwresetlib/mlxfwreset_utils.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
 #
diff --git a/small_utils/mlxfwresetlib/pci_device.py b/small_utils/mlxfwresetlib/pci_device.py
index 69a65ed..04a6c9a 100644
--- a/small_utils/mlxfwresetlib/pci_device.py
+++ b/small_utils/mlxfwresetlib/pci_device.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
 #
diff --git a/small_utils/mstfwreset.py b/small_utils/mstfwreset.py
index 6d45200..f764de3 100755
--- a/small_utils/mstfwreset.py
+++ b/small_utils/mstfwreset.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 
 # Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
 #
-- 
2.20.1