Coverage for watcher/cmd/applier.py: 100%
17 statements
« prev ^ index » next coverage.py v7.8.2, created at 2025-06-17 12:22 +0000
« prev ^ index » next coverage.py v7.8.2, created at 2025-06-17 12:22 +0000
1# -*- encoding: utf-8 -*-
2#
3# Copyright 2013 Hewlett-Packard Development Company, L.P.
4# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
18"""Starter script for the Applier service."""
20import os
21import sys
23from oslo_log import log
25from watcher.applier import manager
26from watcher.applier import sync
27from watcher.common import service as watcher_service
28from watcher import conf
30LOG = log.getLogger(__name__)
31CONF = conf.CONF
34def main():
35 watcher_service.prepare_service(sys.argv, CONF)
37 LOG.info('Starting Watcher Applier service in PID %s', os.getpid())
39 applier_service = watcher_service.Service(manager.ApplierManager)
41 syncer = sync.Syncer()
42 syncer.sync()
44 # Only 1 process
45 launcher = watcher_service.launch(CONF, applier_service)
46 launcher.wait()