Blob Blame History Raw
From 31b83dd2e8ae808d65a0b5a8672dd244d3ce9a0e Mon Sep 17 00:00:00 2001
From: Fabien Boucher <fboucher@redhat.com>
Date: Mon, 18 May 2020 18:49:27 +0200
Subject: [PATCH] Remove ununecessary shebangs

The commands are managed as entry-points so remove
ununecessary shebangs. Also lib/re2util.py does not
require a shebang as well.

zuul_return.py does not have a main and is not supposed
to be run directly.

Ununecessary shebangs for non executable script causes
rpmlint issues.

Change-Id: I6015daaa0fe35b6935fcbffca1907c01c9a26134
---
 zuul/ansible/base/actiongeneral/zuul_return.py |  2 --
 zuul/cmd/__init__.py                           |  1 -
 zuul/cmd/client.py                             |  5 -----
 zuul/cmd/executor.py                           |  5 -----
 zuul/cmd/fingergw.py                           |  1 -
 zuul/cmd/manage_ansible.py                     |  5 -----
 zuul/cmd/migrate.py                            |  6 ------
 zuul/cmd/scheduler.py                          |  5 -----
 zuul/cmd/web.py                                |  5 -----
 zuul/lib/re2util.py                            |  1 -
 zuul/web/__init__.py                           | 14 --------------
 11 files changed, 50 deletions(-)

diff --git a/zuul/ansible/base/actiongeneral/zuul_return.py b/zuul/ansible/base/actiongeneral/zuul_return.py
index 903bab69..772aed02 100644
--- a/zuul/ansible/base/actiongeneral/zuul_return.py
+++ b/zuul/ansible/base/actiongeneral/zuul_return.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-
 # Copyright (c) 2017 Red Hat
 #
 # This module is free software: you can redistribute it and/or modify
diff --git a/zuul/cmd/__init__.py b/zuul/cmd/__init__.py
index 77e5458e..e66128d0 100755
--- a/zuul/cmd/__init__.py
+++ b/zuul/cmd/__init__.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # Copyright 2012 Hewlett-Packard Development Company, L.P.
 # Copyright 2013 OpenStack Foundation
 #
diff --git a/zuul/cmd/client.py b/zuul/cmd/client.py
index 6fc9128a..49d6ea9a 100755
--- a/zuul/cmd/client.py
+++ b/zuul/cmd/client.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # Copyright 2012 Hewlett-Packard Development Company, L.P.
 # Copyright 2013 OpenStack Foundation
 #
@@ -735,7 +734,3 @@ class Client(zuul.cmd.ZuulApp):
 
 def main():
     Client().main()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/zuul/cmd/executor.py b/zuul/cmd/executor.py
index ceb422eb..7b77aed8 100755
--- a/zuul/cmd/executor.py
+++ b/zuul/cmd/executor.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # Copyright 2012 Hewlett-Packard Development Company, L.P.
 # Copyright 2013-2014 OpenStack Foundation
 #
@@ -120,7 +119,3 @@ class Executor(zuul.cmd.ZuulDaemonApp):
 
 def main():
     Executor().main()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/zuul/cmd/fingergw.py b/zuul/cmd/fingergw.py
index 92aac714..63a54010 100644
--- a/zuul/cmd/fingergw.py
+++ b/zuul/cmd/fingergw.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # Copyright 2017 Red Hat, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
diff --git a/zuul/cmd/manage_ansible.py b/zuul/cmd/manage_ansible.py
index cc046ad5..e9a5287f 100644
--- a/zuul/cmd/manage_ansible.py
+++ b/zuul/cmd/manage_ansible.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # Copyright 2019 BMW Group
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -96,7 +95,3 @@ class ManageAnsible(zuul.cmd.ZuulApp):
 
 def main():
     ManageAnsible().main()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/zuul/cmd/migrate.py b/zuul/cmd/migrate.py
index c132a8ca..7fe1d12a 100644
--- a/zuul/cmd/migrate.py
+++ b/zuul/cmd/migrate.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
 # Copyright 2017 Red Hat, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -1744,7 +1742,3 @@ def main():
 
     ZuulMigrate(args.layout, args.job_config, args.nodepool_config,
                 args.outdir, args.mapping, args.syntax_check).run()
-
-
-if __name__ == '__main__':
-    main()
diff --git a/zuul/cmd/scheduler.py b/zuul/cmd/scheduler.py
index 308118f0..b5169346 100755
--- a/zuul/cmd/scheduler.py
+++ b/zuul/cmd/scheduler.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # Copyright 2012 Hewlett-Packard Development Company, L.P.
 # Copyright 2013 OpenStack Foundation
 #
@@ -196,7 +195,3 @@ class Scheduler(zuul.cmd.ZuulDaemonApp):
 
 def main():
     Scheduler().main()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/zuul/cmd/web.py b/zuul/cmd/web.py
index fe4b2ca4..82274fd5 100755
--- a/zuul/cmd/web.py
+++ b/zuul/cmd/web.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # Copyright 2017 Red Hat, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -134,7 +133,3 @@ class WebServer(zuul.cmd.ZuulDaemonApp):
 
 def main():
     WebServer().main()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/zuul/lib/re2util.py b/zuul/lib/re2util.py
index b5cb2cba..5d80ae09 100644
--- a/zuul/lib/re2util.py
+++ b/zuul/lib/re2util.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # Copyright (C) 2020 Red Hat, Inc
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/zuul/web/__init__.py b/zuul/web/__init__.py
index d6df14c5..bae963a7 100755
--- a/zuul/web/__init__.py
+++ b/zuul/web/__init__.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # Copyright (c) 2017 Red Hat
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1271,16 +1270,3 @@ class ZuulWeb(object):
             return
         self.repl.stop()
         self.repl = None
-
-
-if __name__ == "__main__":
-    logging.basicConfig(level=logging.DEBUG)
-    import zuul.lib.connections
-    import zuul.lib.auth.authenticators
-    connections = zuul.lib.connections.ConnectionRegistry()
-    auths = zuul.lib.auth.authenticators.AuthenticatorRegistry()
-    z = ZuulWeb(listen_address="127.0.0.1", listen_port=9000,
-                gear_server="127.0.0.1", gear_port=4730,
-                connections=connections, authenticators=auths)
-    z.start()
-    cherrypy.engine.block()
-- 
2.25.1