[ovs-dev] [PATCH] python: Fixup python shebangs to python3

Greg Rose gvrose8192 at gmail.com
Tue Aug 18 16:45:19 UTC 2020


Builds on RHEL 8.2 systems are failing due to this issue.

See [1] as to why this is necessary.

I used the following command to identify files that need this fix:
find . -type f -executable | /usr/lib/rpm/redhat/brp-mangle-shebangs

I also updated the copyright notices as needed.

1. https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error

Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
---
 ipsec/ovs-monitor-ipsec.in                            |  4 ++--
 ofproto/ipfix-gen-entities                            |  4 ++--
 ovsdb/dot2pic                                         |  4 ++--
 ovsdb/ovsdb-doc                                       |  4 ++--
 ovsdb/ovsdb-dot.in                                    |  2 +-
 ovsdb/ovsdb-idlc.in                                   |  2 +-
 python/build/soutil.py                                |  4 ++--
 tests/ovsdb-monitor-sort.py                           | 16 ++++++++++++++--
 tests/sendpkt.py                                      |  4 ++--
 tests/test-l7.py                                      |  4 ++--
 tests/uuidfilt.py                                     | 18 +++++++++++++++++-
 utilities/bugtool/ovs-bugtool.in                      |  4 ++--
 utilities/ovs-check-dead-ifs.in                       |  2 +-
 utilities/ovs-dev.py                                  |  4 ++--
 utilities/ovs-dpctl-top.in                            |  4 ++--
 utilities/ovs-l3ping.in                               |  2 +-
 utilities/ovs-parse-backtrace.in                      |  4 ++--
 utilities/ovs-pcap.in                                 |  4 ++--
 utilities/ovs-pipegen.py                              |  4 ++--
 utilities/ovs-tcpdump.in                              |  2 +-
 utilities/ovs-tcpundump.in                            |  4 ++--
 utilities/ovs-test.in                                 |  2 +-
 utilities/ovs-vlan-test.in                            |  4 ++--
 vtep/ovs-vtep.in                                      |  4 ++--
 xenserver/etc_xapi.d_plugins_openvswitch-cfg-update   |  4 ++--
 xenserver/opt_xensource_libexec_interface-reconfigure |  2 +-
 xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync |  4 ++--
 27 files changed, 74 insertions(+), 46 deletions(-)

diff --git a/ipsec/ovs-monitor-ipsec.in b/ipsec/ovs-monitor-ipsec.in
index 37e3703..32e8e90 100755
--- a/ipsec/ovs-monitor-ipsec.in
+++ b/ipsec/ovs-monitor-ipsec.in
@@ -1,5 +1,5 @@
-#! @PYTHON3@
-# Copyright (c) 2017 Nicira, Inc.
+#!/usr/bin/env python3
+# Copyright (c) 2017, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/ofproto/ipfix-gen-entities b/ofproto/ipfix-gen-entities
index 0be7199..d5abe9c 100755
--- a/ofproto/ipfix-gen-entities
+++ b/ofproto/ipfix-gen-entities
@@ -1,6 +1,6 @@
-#! /usr/bin/env python
+#!/usr/bin/env python3
 #
-# Copyright (C) 2012 Nicira, Inc.
+# Copyright (C) 2012, 2020 Nicira, Inc.
 #
 # Copying and distribution of this file, with or without modification,
 # are permitted in any medium without royalty provided the copyright
diff --git a/ovsdb/dot2pic b/ovsdb/dot2pic
index de67261..2f858e1 100755
--- a/ovsdb/dot2pic
+++ b/ovsdb/dot2pic
@@ -1,6 +1,6 @@
-#! /usr/bin/env python
+#!/usr/bin/env python3
 
-# Copyright (c) 2009, 2010, 2011, 2013, 2017 Nicira, Inc.
+# Copyright (c) 2009, 2010, 2011, 2013, 2017, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/ovsdb/ovsdb-doc b/ovsdb/ovsdb-doc
index 406c293..10d0c0c 100755
--- a/ovsdb/ovsdb-doc
+++ b/ovsdb/ovsdb-doc
@@ -1,6 +1,6 @@
-#! /usr/bin/python
+#!/usr/bin/python3
 
-# Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
+# Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/ovsdb/ovsdb-dot.in b/ovsdb/ovsdb-dot.in
index 41b986c..571601e 100755
--- a/ovsdb/ovsdb-dot.in
+++ b/ovsdb/ovsdb-dot.in
@@ -1,4 +1,4 @@
-#! @PYTHON3@
+#!/usr/bin/env python3
 
 from datetime import date
 import ovs.db.error
diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in
index 698fe25..de42519 100755
--- a/ovsdb/ovsdb-idlc.in
+++ b/ovsdb/ovsdb-idlc.in
@@ -1,4 +1,4 @@
-#! @PYTHON3@
+#!/usr/bin/env python3
 
 from __future__ import print_function
 import getopt
diff --git a/python/build/soutil.py b/python/build/soutil.py
index b8027af..bb6c911 100755
--- a/python/build/soutil.py
+++ b/python/build/soutil.py
@@ -1,6 +1,6 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 
-# Copyright (c) 2008, 2017 Nicira, Inc.
+# Copyright (c) 2008, 2017, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/tests/ovsdb-monitor-sort.py b/tests/ovsdb-monitor-sort.py
index 7d368a7..da4ee2a 100755
--- a/tests/ovsdb-monitor-sort.py
+++ b/tests/ovsdb-monitor-sort.py
@@ -1,5 +1,17 @@
-#! /usr/bin/env python
-
+#! /usr/bin/env python3
+# Copyright (c) 2020 VMware, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 # Breaks lines read from stdin into groups using blank lines as
 # group separators, then sorts lines within the groups for
 # reproducibility.
diff --git a/tests/sendpkt.py b/tests/sendpkt.py
index 328ae2b..d0e24f4 100755
--- a/tests/sendpkt.py
+++ b/tests/sendpkt.py
@@ -1,6 +1,6 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 
-# Copyright (c) 2018 VMware, Inc.
+# Copyright (c) 2018, 2020 VMware, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/tests/test-l7.py b/tests/test-l7.py
index d7854a1..32a7739 100755
--- a/tests/test-l7.py
+++ b/tests/test-l7.py
@@ -1,5 +1,5 @@
-#!/usr/bin/env python
-# Copyright (c) 2015, 2016 Nicira, Inc.
+#!/usr/bin/env python3
+# Copyright (c) 2015, 2016, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/tests/uuidfilt.py b/tests/uuidfilt.py
index bc49aa4..39679dd 100755
--- a/tests/uuidfilt.py
+++ b/tests/uuidfilt.py
@@ -1,4 +1,20 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
+# Copyright (c) 2020 VMware, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Breaks lines read from stdin into groups using blank lines as
+# group separators, then sorts lines within the groups for
+# reproducibility.
 
 import re
 import sys
diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in
index ddb5bc8..a0202ae 100755
--- a/utilities/bugtool/ovs-bugtool.in
+++ b/utilities/bugtool/ovs-bugtool.in
@@ -1,4 +1,4 @@
-#! @PYTHON3@
+#!/usr/bin/env python3
 
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of version 2.1 of the GNU Lesser General Public
@@ -14,7 +14,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 # Copyright (c) 2005, 2007 XenSource Ltd.
-# Copyright (c) 2010, 2011, 2012, 2013, 2015, 2016, 2017 Nicira, Inc.
+# Copyright (c) 2010, 2011, 2012, 2013, 2015, 2016, 2017, 2020 Nicira, Inc.
 
 #
 # To add new entries to the bugtool, you need to:
diff --git a/utilities/ovs-check-dead-ifs.in b/utilities/ovs-check-dead-ifs.in
index bf35657..e38dffd 100755
--- a/utilities/ovs-check-dead-ifs.in
+++ b/utilities/ovs-check-dead-ifs.in
@@ -1,4 +1,4 @@
-#! @PYTHON3@
+#! /usr/bin/env python3
 
 import os
 import re
diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py
index 248d22a..c45788a 100755
--- a/utilities/ovs-dev.py
+++ b/utilities/ovs-dev.py
@@ -1,5 +1,5 @@
-#!/usr/bin/env python
-# Copyright (c) 2013, 2014, 2015, 2016 Nicira, Inc.
+#!/usr/bin/env python3
+# Copyright (c) 2013, 2014, 2015, 2016, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/utilities/ovs-dpctl-top.in b/utilities/ovs-dpctl-top.in
index 011cc64..1b5e56f 100755
--- a/utilities/ovs-dpctl-top.in
+++ b/utilities/ovs-dpctl-top.in
@@ -1,6 +1,6 @@
-#! @PYTHON3@
+#! /usr/bin/env python3
 #
-# Copyright (c) 2013 Nicira, Inc.
+# Copyright (c) 2013, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/utilities/ovs-l3ping.in b/utilities/ovs-l3ping.in
index 92d32ac..5acecab 100644
--- a/utilities/ovs-l3ping.in
+++ b/utilities/ovs-l3ping.in
@@ -1,4 +1,4 @@
-#! @PYTHON3@
+#! /usr/bin/env python3
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/utilities/ovs-parse-backtrace.in b/utilities/ovs-parse-backtrace.in
index d550676..f360d03 100755
--- a/utilities/ovs-parse-backtrace.in
+++ b/utilities/ovs-parse-backtrace.in
@@ -1,6 +1,6 @@
-#! @PYTHON3@
+#! /usr/bin/env python3
 #
-# Copyright (c) 2012 Nicira, Inc.
+# Copyright (c) 2012, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/utilities/ovs-pcap.in b/utilities/ovs-pcap.in
index dddbee4..e37872d 100755
--- a/utilities/ovs-pcap.in
+++ b/utilities/ovs-pcap.in
@@ -1,6 +1,6 @@
-#! @PYTHON3@
+#! /usr/bin/env python3
 #
-# Copyright (c) 2010 Nicira, Inc.
+# Copyright (c) 2010, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/utilities/ovs-pipegen.py b/utilities/ovs-pipegen.py
index ee57972..a3b6a66 100755
--- a/utilities/ovs-pipegen.py
+++ b/utilities/ovs-pipegen.py
@@ -1,5 +1,5 @@
-#! /usr/bin/env python
-# Copyright (c) 2013, 2014, 2015 Nicira, Inc.
+#! /usr/bin/env python3
+# Copyright (c) 2013, 2014, 2015, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/utilities/ovs-tcpdump.in b/utilities/ovs-tcpdump.in
index 5ec0238..237805b 100755
--- a/utilities/ovs-tcpdump.in
+++ b/utilities/ovs-tcpdump.in
@@ -1,4 +1,4 @@
-#! @PYTHON3@
+#! /usr/bin/env python3
 #
 # Copyright (c) 2016 Red Hat, Inc.
 #
diff --git a/utilities/ovs-tcpundump.in b/utilities/ovs-tcpundump.in
index ede5448..f56833e 100755
--- a/utilities/ovs-tcpundump.in
+++ b/utilities/ovs-tcpundump.in
@@ -1,6 +1,6 @@
-#! @PYTHON3@
+#! /usr/bin/env python3
 #
-# Copyright (c) 2010 Nicira, Inc.
+# Copyright (c) 2010, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/utilities/ovs-test.in b/utilities/ovs-test.in
index eb712ff..1635af0 100644
--- a/utilities/ovs-test.in
+++ b/utilities/ovs-test.in
@@ -1,4 +1,4 @@
-#! @PYTHON3@
+#! /usr/bin/env python3
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/utilities/ovs-vlan-test.in b/utilities/ovs-vlan-test.in
index 154573a..ce0bb54 100755
--- a/utilities/ovs-vlan-test.in
+++ b/utilities/ovs-vlan-test.in
@@ -1,6 +1,6 @@
-#! @PYTHON3@
+#! /usr/bin/env python3
 #
-# Copyright (c) 2010 Nicira, Inc.
+# Copyright (c) 2010, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/vtep/ovs-vtep.in b/vtep/ovs-vtep.in
index 0ee23b1..8acefdd 100755
--- a/vtep/ovs-vtep.in
+++ b/vtep/ovs-vtep.in
@@ -1,5 +1,5 @@
-#! @PYTHON3@
-# Copyright (C) 2013 Nicira, Inc. All Rights Reserved.
+#! /usr/bin/env python3
+# Copyright (C) 2013, 2020 Nicira, Inc. All Rights Reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update
index e7404e3..b8db881 100755
--- a/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update
+++ b/xenserver/etc_xapi.d_plugins_openvswitch-cfg-update
@@ -1,10 +1,10 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # xapi plugin script to update the cache of configuration items in the
 # ovs-vswitchd configuration that are managed in the xapi database when
 # integrated with Citrix management tools.
 
-# Copyright (C) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
diff --git a/xenserver/opt_xensource_libexec_interface-reconfigure b/xenserver/opt_xensource_libexec_interface-reconfigure
index a82043f..9c20725 100755
--- a/xenserver/opt_xensource_libexec_interface-reconfigure
+++ b/xenserver/opt_xensource_libexec_interface-reconfigure
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Copyright (c) 2008,2009 Citrix Systems, Inc.
 #
diff --git a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync
index cf89600..1bd56a6 100755
--- a/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync
+++ b/xenserver/usr_share_openvswitch_scripts_ovs-xapi-sync
@@ -1,5 +1,5 @@
-#! /usr/bin/env python
-# Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+#! /usr/bin/env python3
+# Copyright (c) 2009, 2010, 2011, 2012, 2013, 2020 Nicira, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
-- 
1.8.3.1



More information about the dev mailing list