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
diff --git a/zuul/cmd/__init__.py b/zuul/cmd/__init__.py
index bdb9397..2aad4eb 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 @@
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 @@
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()