Coverage for watcher/conf/nova_client.py: 100%

9 statements  

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

1# -*- encoding: utf-8 -*- 

2# Copyright (c) 2016 Intel Corp 

3# 

4# Authors: Prudhvi Rao Shedimbi <prudhvi.rao.shedimbi@intel.com> 

5# 

6# Licensed under the Apache License, Version 2.0 (the "License"); 

7# you may not use this file except in compliance with the License. 

8# You may obtain 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, 

14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 

15# implied. 

16# See the License for the specific language governing permissions and 

17# limitations under the License. 

18 

19from oslo_config import cfg 

20 

21from watcher.common import clients 

22 

23nova_client = cfg.OptGroup(name='nova_client', 

24 title='Configuration Options for Nova') 

25 

26NOVA_CLIENT_OPTS = [ 

27 cfg.StrOpt('api_version', 

28 default='2.56', 

29 help=""" 

30Version of Nova API to use in novaclient. 

31 

32Minimum required version: %s 

33 

34Certain Watcher features depend on a minimum version of the compute 

35API being available which is enforced with this option. See 

36https://docs.openstack.org/nova/latest/reference/api-microversion-history.html 

37for the compute API microversion history. 

38""" % clients.MIN_NOVA_API_VERSION), 

39 cfg.StrOpt('endpoint_type', 

40 default='publicURL', 

41 help='Type of endpoint to use in novaclient. ' 

42 'Supported values: internalURL, publicURL, adminURL. ' 

43 'The default is publicURL.'), 

44 cfg.StrOpt('region_name', 

45 help='Region in Identity service catalog to use for ' 

46 'communication with the OpenStack service.')] 

47 

48 

49def register_opts(conf): 

50 conf.register_group(nova_client) 

51 conf.register_opts(NOVA_CLIENT_OPTS, group=nova_client) 

52 

53 

54def list_opts(): 

55 return [(nova_client, NOVA_CLIENT_OPTS)]