Coverage for watcher/common/config.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.8.2, created at 2025-06-17 12:22 +0000

1# Copyright 2010 United States Government as represented by the 

2# Administrator of the National Aeronautics and Space Administration. 

3# All Rights Reserved. 

4# Copyright 2012 Red Hat, Inc. 

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. 

17 

18from oslo_config import cfg 

19 

20from watcher.common import rpc 

21from watcher import version 

22 

23 

24def parse_args(argv, default_config_files=None, default_config_dirs=None): 

25 default_config_files = (default_config_files or 

26 cfg.find_config_files(project='watcher')) 

27 default_config_dirs = (default_config_dirs or 

28 cfg.find_config_dirs(project='watcher')) 

29 rpc.set_defaults(control_exchange='watcher') 

30 cfg.CONF(argv[1:], 

31 project='watcher', 

32 version=version.version_info.release_string(), 

33 default_config_dirs=default_config_dirs, 

34 default_config_files=default_config_files) 

35 rpc.init(cfg.CONF)