summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Henkel <tobias.henkel@bmw.de>2017-12-27 10:24:04 +0100
committerTobias Henkel <tobias.henkel@bmw.de>2017-12-27 10:28:55 +0100
commit379523bd09e4bbd9f475d316cddea0cb154a906b (patch)
tree156b57aed20b29e6a5cf3d8f9aeb3c1d8bfb366a
parent30cbb65b4315820b89333e3683e4c350ec173a81 (diff)
downloadzuul-379523bd09e4bbd9f475d316cddea0cb154a906b.tar.gz
Make ZuulDaemonApp an abstract base class
We use ZuulDaemonApp like an abstract base class with run() as an abstract method so make that explicit. This creates the groundwork for later refactorings like centralized signal handling. Change-Id: I20f14274df27ab181711b2ca2b80251fa5b09938
-rwxr-xr-xzuul/cmd/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/zuul/cmd/__init__.py b/zuul/cmd/__init__.py
index bdb93978f..2aad4eb39 100755
--- a/zuul/cmd/__init__.py
+++ b/zuul/cmd/__init__.py
@@ -14,6 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+import abc
import argparse
import configparser
import daemon
@@ -156,7 +157,7 @@ class ZuulApp(object):
self.connections.configure(self.config, source_only)
-class ZuulDaemonApp(ZuulApp):
+class ZuulDaemonApp(ZuulApp, metaclass=abc.ABCMeta):
def createParser(self):
parser = super(ZuulDaemonApp, self).createParser()
parser.add_argument('-d', dest='nodaemon', action='store_true',
@@ -169,6 +170,13 @@ class ZuulDaemonApp(ZuulApp):
expand_user=True)
return pid_fn
+ @abc.abstractmethod
+ def run(self):
+ """
+ This is the main run method of the application.
+ """
+ pass
+
def main(self):
self.parseArguments()
self.readConfig()