Completed
Push — master ( d1f0a7...3b2ece )
by Edward
21:04 queued 05:38
created

st2reactor.rules.SensorWrapper   A

Complexity

Total Complexity 22

Size/Duplication

Total Lines 179
Duplicated Lines 0 %
Metric Value
wmc 22
dl 0
loc 179
rs 10
1
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
2
# contributor license agreements.  See the NOTICE file distributed with
3
# this work for additional information regarding copyright ownership.
4
# The ASF licenses this file to You under the Apache License, Version 2.0
5
# (the "License"); you may not use this file except in compliance with
6
# the License.  You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15
16
from oslo_config import cfg
17
18
import st2common.config as common_config
19
from st2common.constants.system import VERSION_STRING
20
common_config.register_opts()
21
22
CONF = cfg.CONF
23
24
25
def parse_args(args=None):
26
    CONF(args=args, version=VERSION_STRING)
27
28
29
def register_opts():
30
    _register_common_opts()
31
    _register_rules_engine_opts()
32
33
34
def get_logging_config_path():
35
    return cfg.CONF.rulesengine.logging
36
37
38
def _register_common_opts():
39
    common_config.register_opts()
40
41
42
def _register_rules_engine_opts():
43
    logging_opts = [
44
        cfg.StrOpt('logging', default='conf/logging.rulesengine.conf',
45
                   help='Location of the logging configuration file.')
46
    ]
47
    CONF.register_opts(logging_opts, group='rulesengine')
48
49
    timer_opts = [
50
        cfg.StrOpt('local_timezone', default='America/Los_Angeles',
51
                   help='Timezone pertaining to the location where st2 is run.')
52
    ]
53
    CONF.register_opts(timer_opts, group='timer')
54
55
56
register_opts()
57