Coverage for watcher/api/wsgi.py: 0%

16 statements  

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

1# Licensed under the Apache License, Version 2.0 (the "License"); you may 

2# not use this file except in compliance with the License. You may obtain 

3# a copy of the License at 

4# 

5# http://www.apache.org/licenses/LICENSE-2.0 

6# 

7# Unless required by applicable law or agreed to in writing, software 

8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 

9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 

10# License for the specific language governing permissions and limitations 

11# under the License. 

12"""WSGI script for Watcher API, installed by pbr.""" 

13 

14import sys 

15 

16from oslo_config import cfg 

17import oslo_i18n as i18n 

18from oslo_log import log 

19 

20from watcher.api import app 

21from watcher.common import service 

22 

23 

24CONF = cfg.CONF 

25LOG = log.getLogger(__name__) 

26 

27 

28def initialize_wsgi_app(show_deprecated=False): 

29 i18n.install('watcher') 

30 

31 service.prepare_service(sys.argv) 

32 

33 LOG.debug("Configuration:") 

34 CONF.log_opt_values(LOG, log.DEBUG) 

35 

36 if show_deprecated: 

37 LOG.warning("Using watcher/api/app.wsgi is deprecated and it will " 

38 "be removed in U release. Please use automatically " 

39 "generated watcher-api-wsgi instead.") 

40 

41 return app.VersionSelectorApplication()