Skip to content

Commit

Permalink
Replace PYTHONSHEBANG with valid shebang
Browse files Browse the repository at this point in the history
Replace the @PYTHONSHEBANG@ substitution with a valid #!/usr/bin/python3
shebang. This turns Python .in files into valid Python files. The files
can now be checked with pylint and IDEs recognize the files as Python
files.

The shebang is still replaced with "#!$(PYTHON) -E" to support
platform-python.

Related: https://pagure.io/freeipa/issue/7984
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Francois Cami <fcami@redhat.com>
  • Loading branch information
tiran committed Jun 24, 2019
1 parent d86b57c commit 6d02edd
Show file tree
Hide file tree
Showing 54 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion Makefile.pythonscripts.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# special handling of Python scripts with auto-generated shebang line
$(PYTHON_SHEBANG):%: %.in Makefile
$(AM_V_GEN)sed -e 's|@PYTHONSHEBANG[@]|#!$(PYTHON) -E|g' $< > $@
$(AM_V_GEN)sed -e 's|^#!/usr/bin/python3.*|#!$(PYTHON) -E|g' $< > $@
$(AM_V_GEN)chmod +x $@

.PHONY: python_scripts_sub
Expand Down
2 changes: 1 addition & 1 deletion client/ipa-certupdate.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Jan Cholasta <jcholast@redhat.com>
#
# Copyright (C) 2014 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion client/ipa-client-automount.in
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Authors:
# Rob Crittenden <rcritten@redhat.com>
Expand Down
2 changes: 1 addition & 1 deletion client/ipa-client-install.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Simo Sorce <ssorce@redhat.com>
# Karl MacMillan <kmacmillan@mentalrootkit.com>
#
Expand Down
2 changes: 1 addition & 1 deletion daemons/dnssec/ipa-dnskeysync-replica.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion daemons/dnssec/ipa-dnskeysyncd.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion daemons/dnssec/ipa-ods-exporter.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion install/certmonger/dogtag-ipa-ca-renew-agent-submit.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Authors:
# Jan Cholasta <jcholast@redhat.com>
Expand Down
2 changes: 1 addition & 1 deletion install/certmonger/ipa-server-guard.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Authors:
# Jan Cholasta <jcholast@redhat.com>
Expand Down
2 changes: 1 addition & 1 deletion install/custodia/ipa-custodia-dmldap.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2019 IPA Project Contributors, see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion install/custodia/ipa-custodia-pki-tomcat-wrapped.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2019 IPA Project Contributors, see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion install/custodia/ipa-custodia-pki-tomcat.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2019 IPA Project Contributors, see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion install/custodia/ipa-custodia-ra-agent.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2019 IPA Project Contributors, see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion install/oddjob/com.redhat.idm.trust-fetch-domains.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3

from ipaserver import dcerpc
from ipaserver.install.installutils import is_ipa_configured, ScriptError
Expand Down
2 changes: 1 addition & 1 deletion install/restart_scripts/renew_ca_cert.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Authors:
# Rob Crittenden <rcritten@redhat.com>
Expand Down
2 changes: 1 addition & 1 deletion install/restart_scripts/renew_kdc_cert.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2017 FreeIPA Contributors see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion install/restart_scripts/renew_ra_cert.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Authors:
# Rob Crittenden <rcritten@redhat.com>
Expand Down
2 changes: 1 addition & 1 deletion install/restart_scripts/renew_ra_cert_pre.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion install/restart_scripts/restart_dirsrv.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Authors:
# Rob Crittenden <rcritten@redhat.com>
Expand Down
2 changes: 1 addition & 1 deletion install/restart_scripts/restart_httpd.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Authors:
# Rob Crittenden <rcritten@redhat.com>
Expand Down
2 changes: 1 addition & 1 deletion install/restart_scripts/stop_pkicad.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Authors:
# Rob Crittenden <rcritten@redhat.com>
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-adtrust-install.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Authors: Sumit Bose <sbose@redhat.com>
# Based on ipa-server-install by Karl MacMillan <kmacmillan@mentalrootkit.com>
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-advise.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Tomas Babej <tbabej@redhat.com>
#
# Copyright (C) 2013 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-backup.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2013 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-ca-install.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2011 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-cacert-manage.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Jan Cholasta <jcholast@redhat.com>
#
# Copyright (C) 2014 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-cert-fix.in
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2019 FreeIPA Contributors see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-compat-manage.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Rob Crittenden <rcritten@redhat.com>
# Authors: Simo Sorce <ssorce@redhat.com>
#
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-crlgen-manage.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2019 FreeIPA Contributors see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-csreplica-manage.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Rob Crittenden <rcritten@redhat.com>
#
# Based on ipa-replica-manage by Karl MacMillan <kmacmillan@mentalrootkit.com>
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-custodia-check.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
"""Test client for ipa-custodia
The test script is expected to be executed on an IPA server with existing
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-custodia.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Copyright (C) 2017 IPA Project Contributors, see COPYING for license
from ipaserver.secrets.service import main

Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-dns-install.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Martin Nagy <mnagy@redhat.com>
# Based on ipa-server-install by Karl MacMillan <kmacmillan@mentalrootkit.com>
#
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-httpd-kdcproxy.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors:
# Christian Heimes <cheimes@redhat.com>
#
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-kra-install.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Ade Lee <alee@redhat.com>
#
# Copyright (C) 2014 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-ldap-updater.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2008 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-managed-entries.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Jr Aquino <jr.aquino@citrix.com>
#
# Copyright (C) 2011 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-nis-manage.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Rob Crittenden <rcritten@redhat.com>
# Authors: Simo Sorce <ssorce@redhat.com>
#
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-otptoken-import.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Nathaniel McCallum <npmccallum@redhat.com>
#
# Copyright (C) 2014 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-pki-retrieve-key.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3

from __future__ import print_function

Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-pki-wait-running.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
"""Wait until pki-tomcatd is up
The script polls on Dogtag's HTTP port and wait until the admin interface
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-pkinit-manage.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2017 FreeIPA Contributors see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-replica-conncheck.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Martin Kosek <mkosek@redhat.com>
#
# Copyright (C) 2011 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-replica-install.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
#
# Copyright (C) 2007 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-replica-manage.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
#
# Copyright (C) 2007 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-restore.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2013 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-server-certinstall.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Jan Cholasta <jcholast@redhat.com>
#
# Copyright (C) 2013 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-server-install.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Karl MacMillan <kmacmillan@mentalrootkit.com>
# Simo Sorce <ssorce@redhat.com>
# Rob Crittenden <rcritten@redhat.com>
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-server-upgrade.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
#
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
#
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipa-winsync-migrate.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Tomas Babej <tbabej@redhat.com>
#
# Copyright (C) 2015 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion install/tools/ipactl.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors: Simo Sorce <ssorce@redhat.com>
#
# Copyright (C) 2008-2010 Red Hat
Expand Down
2 changes: 1 addition & 1 deletion ipa.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3

# Authors:
# Jason Gerard DeRose <jderose@redhat.com>
Expand Down
2 changes: 1 addition & 1 deletion makeaci.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors:
# Petr Viktorin <pviktori@redhat.com>
# John Dennis <jdennis@redhat.com>
Expand Down
2 changes: 1 addition & 1 deletion makeapi.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@PYTHONSHEBANG@
#!/usr/bin/python3
# Authors:
# Rob Crittenden <rcritten@redhat.com>
# John Dennis <jdennis@redhat.com>
Expand Down

0 comments on commit 6d02edd

Please sign in to comment.