blob: de418a2274f0fa94a94ad0cbce009eeaf435466e [file] [log] [blame]
Sapan Bhatia2810e032017-11-03 00:31:00 -04001# Copyright 2017-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15
16#!/usr/bin/env python
17
18# This imports and runs ../../xos-observer.py
19
20import importlib
21import os
22import sys
23from xosconfig import Config
24
Matteo Scandolo0f20e262018-06-12 14:18:35 -070025base_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/config.yaml')
26mounted_config_file = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/mounted_config.yaml')
Sapan Bhatia2810e032017-11-03 00:31:00 -040027
Matteo Scandolo0f20e262018-06-12 14:18:35 -070028if os.path.isfile(mounted_config_file):
29 Config.init(base_config_file, 'synchronizer-config-schema.yaml', mounted_config_file)
30else:
31 Config.init(base_config_file, 'synchronizer-config-schema.yaml')
Sapan Bhatia2810e032017-11-03 00:31:00 -040032
33observer_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"../../synchronizers/new_base")
34sys.path.append(observer_path)
35mod = importlib.import_module("xos-synchronizer")
36mod.main()