RIFT OSM R1 Initial Submission
[osm/SO.git] / common / python / rift / mano / yang_translator / conf / __init__.py
1 #
2 # Licensed under the Apache License, Version 2.0 (the "License"); you may
3 # not use this file except in compliance with the License. You may obtain
4 # a copy of the License at
5 #
6 # http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 # License for the specific language governing permissions and limitations
12 # under the License.
13 #
14 # Copyright 2016 RIFT.io Inc
15
16
17 ''' Initialize the global configuration for the translator '''
18
19 import os
20
21 from rift.mano.yang_translator.conf.config import ConfigProvider
22
23 CONF_FILENAME = 'translator.conf'
24
25
26 def init_global_conf():
27 '''Initialize the configuration provider.
28
29 Allows the configuration to be shared throughout the translator code.
30 The file used is translator.conf, and is within the conf/ directory. It
31 is a standard ini format, and is prcessed using the ConfigParser module.
32
33 '''
34 conf_path = os.path.dirname(os.path.abspath(__file__))
35 conf_file = os.path.join(conf_path, CONF_FILENAME)
36 ConfigProvider._load_config(conf_file)
37
38
39 init_global_conf()