
Use config tools from Oslo-incubator : * generate a consistant config file sample: etc/climate/climate.conf.sample * Add a new check in tox env 'pep8' to check out-dated config file sample. Move specifics options for admin credential in group config 'physical:host' Factorize by declaring config options in each plugins with available values and centralizing RESOURCE_TYPE value in plugin's module (one dir per plugin) Use socket.gethostname() in place of socket.getfqdn() to have predictable default value for 'host' config in climate.config, since it's ugly forced in openstack.common.config.generator#L232 Fixes: bug #1271875 Change-Id: Ie54fc98b58b49400360c4fd2ce7d8bb3b75915e2
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
# Copyright (c) 2014 Bull.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
# implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
from oslo.config import cfg
|
|
|
|
RESOURCE_TYPE = u'physical:host'
|
|
|
|
admin_opts = [
|
|
cfg.StrOpt('climate_username',
|
|
default='climate_admin',
|
|
help='Name of the user for write operations'),
|
|
cfg.StrOpt('climate_password',
|
|
default='climate_password',
|
|
help='Password of the user for write operations'),
|
|
cfg.StrOpt('climate_tenant_name',
|
|
default='admin',
|
|
help='Tenant of the user for write operations'),
|
|
]
|
|
|
|
cfg.CONF.register_opts(admin_opts, group=RESOURCE_TYPE)
|