Remove unused conf opts
The advent of a working 'tox -egenconfig' makes it easy to determine which conf opts from nova are not being used by placement. This change gets most of them, but leaves out opt removals provided by change I91361ea31c015542be52f905d75d2ca53c61103f Change-Id: I070d26faebeca4aa803a1cbf85e5f17a1149cf74
This commit is contained in:
parent
b48ff9d556
commit
d91261ef62
@ -18,10 +18,10 @@ from oslo_config import cfg
|
||||
api_group = cfg.OptGroup('api',
|
||||
title='API options',
|
||||
help="""
|
||||
Options under this group are used to define Nova API.
|
||||
Options under this group are used to define Placement API.
|
||||
""")
|
||||
|
||||
auth_opts = [
|
||||
api_opts = [
|
||||
cfg.StrOpt("auth_strategy",
|
||||
default="keystone",
|
||||
choices=("keystone", "noauth2"),
|
||||
@ -31,389 +31,14 @@ This determines the strategy to use for authentication: keystone or noauth2.
|
||||
'noauth2' is designed for testing only, as it does no actual credential
|
||||
checking. 'noauth2' provides administrative credentials only if 'admin' is
|
||||
specified as the username.
|
||||
"""),
|
||||
cfg.BoolOpt("use_forwarded_for",
|
||||
default=False,
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
When True, the 'X-Forwarded-For' header is treated as the canonical remote
|
||||
address. When False (the default), the 'remote_address' header is used.
|
||||
|
||||
You should only enable this if you have an HTML sanitizing proxy.
|
||||
"""),
|
||||
]
|
||||
|
||||
metadata_opts = [
|
||||
cfg.StrOpt("config_drive_skip_versions",
|
||||
default=("1.0 2007-01-19 2007-03-01 2007-08-29 2007-10-10 "
|
||||
"2007-12-15 2008-02-01 2008-09-01"),
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
When gathering the existing metadata for a config drive, the EC2-style
|
||||
metadata is returned for all versions that don't appear in this option.
|
||||
As of the Liberty release, the available versions are:
|
||||
|
||||
* 1.0
|
||||
* 2007-01-19
|
||||
* 2007-03-01
|
||||
* 2007-08-29
|
||||
* 2007-10-10
|
||||
* 2007-12-15
|
||||
* 2008-02-01
|
||||
* 2008-09-01
|
||||
* 2009-04-04
|
||||
|
||||
The option is in the format of a single string, with each version separated
|
||||
by a space.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any string that represents zero or more versions, separated by spaces.
|
||||
"""),
|
||||
cfg.ListOpt('vendordata_providers',
|
||||
item_type=cfg.types.String(choices=['StaticJSON', 'DynamicJSON']),
|
||||
default=['StaticJSON'],
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
A list of vendordata providers.
|
||||
|
||||
vendordata providers are how deployers can provide metadata via configdrive
|
||||
and metadata that is specific to their deployment. There are currently two
|
||||
supported providers: StaticJSON and DynamicJSON.
|
||||
|
||||
StaticJSON reads a JSON file configured by the flag vendordata_jsonfile_path
|
||||
and places the JSON from that file into vendor_data.json and
|
||||
vendor_data2.json.
|
||||
|
||||
DynamicJSON is configured via the vendordata_dynamic_targets flag, which is
|
||||
documented separately. For each of the endpoints specified in that flag, a
|
||||
section is added to the vendor_data2.json.
|
||||
|
||||
For more information on the requirements for implementing a vendordata
|
||||
dynamic endpoint, please see the vendordata.rst file in the nova developer
|
||||
reference.
|
||||
|
||||
Possible values:
|
||||
|
||||
* A list of vendordata providers, with StaticJSON and DynamicJSON being
|
||||
current options.
|
||||
|
||||
Related options:
|
||||
|
||||
* vendordata_dynamic_targets
|
||||
* vendordata_dynamic_ssl_certfile
|
||||
* vendordata_dynamic_connect_timeout
|
||||
* vendordata_dynamic_read_timeout
|
||||
* vendordata_dynamic_failure_fatal
|
||||
"""),
|
||||
cfg.ListOpt('vendordata_dynamic_targets',
|
||||
default=[],
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
A list of targets for the dynamic vendordata provider. These targets are of
|
||||
the form <name>@<url>.
|
||||
|
||||
The dynamic vendordata provider collects metadata by contacting external REST
|
||||
services and querying them for information about the instance. This behaviour
|
||||
is documented in the vendordata.rst file in the nova developer reference.
|
||||
"""),
|
||||
cfg.StrOpt('vendordata_dynamic_ssl_certfile',
|
||||
default='',
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
Path to an optional certificate file or CA bundle to verify dynamic
|
||||
vendordata REST services ssl certificates against.
|
||||
|
||||
Possible values:
|
||||
|
||||
* An empty string, or a path to a valid certificate file
|
||||
|
||||
Related options:
|
||||
|
||||
* vendordata_providers
|
||||
* vendordata_dynamic_targets
|
||||
* vendordata_dynamic_connect_timeout
|
||||
* vendordata_dynamic_read_timeout
|
||||
* vendordata_dynamic_failure_fatal
|
||||
"""),
|
||||
cfg.IntOpt('vendordata_dynamic_connect_timeout',
|
||||
default=5,
|
||||
min=3,
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
Maximum wait time for an external REST service to connect.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any integer with a value greater than three (the TCP packet retransmission
|
||||
timeout). Note that instance start may be blocked during this wait time,
|
||||
so this value should be kept small.
|
||||
|
||||
Related options:
|
||||
|
||||
* vendordata_providers
|
||||
* vendordata_dynamic_targets
|
||||
* vendordata_dynamic_ssl_certfile
|
||||
* vendordata_dynamic_read_timeout
|
||||
* vendordata_dynamic_failure_fatal
|
||||
"""),
|
||||
cfg.IntOpt('vendordata_dynamic_read_timeout',
|
||||
default=5,
|
||||
min=0,
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
Maximum wait time for an external REST service to return data once connected.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any integer. Note that instance start is blocked during this wait time,
|
||||
so this value should be kept small.
|
||||
|
||||
Related options:
|
||||
|
||||
* vendordata_providers
|
||||
* vendordata_dynamic_targets
|
||||
* vendordata_dynamic_ssl_certfile
|
||||
* vendordata_dynamic_connect_timeout
|
||||
* vendordata_dynamic_failure_fatal
|
||||
"""),
|
||||
cfg.BoolOpt('vendordata_dynamic_failure_fatal',
|
||||
default=False,
|
||||
help="""
|
||||
Should failures to fetch dynamic vendordata be fatal to instance boot?
|
||||
|
||||
Related options:
|
||||
|
||||
* vendordata_providers
|
||||
* vendordata_dynamic_targets
|
||||
* vendordata_dynamic_ssl_certfile
|
||||
* vendordata_dynamic_connect_timeout
|
||||
* vendordata_dynamic_read_timeout
|
||||
"""),
|
||||
cfg.IntOpt("metadata_cache_expiration",
|
||||
default=15,
|
||||
min=0,
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
This option is the time (in seconds) to cache metadata. When set to 0,
|
||||
metadata caching is disabled entirely; this is generally not recommended for
|
||||
performance reasons. Increasing this setting should improve response times
|
||||
of the metadata API when under heavy load. Higher values may increase memory
|
||||
usage, and result in longer times for host metadata changes to take effect.
|
||||
"""),
|
||||
]
|
||||
|
||||
file_opts = [
|
||||
cfg.StrOpt("vendordata_jsonfile_path",
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
Cloud providers may store custom data in vendor data file that will then be
|
||||
available to the instances via the metadata service, and to the rendering of
|
||||
config-drive. The default class for this, JsonFileVendorData, loads this
|
||||
information from a JSON file, whose path is configured by this option. If
|
||||
there is no path set by this option, the class returns an empty dictionary.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any string representing the path to the data file, or an empty string
|
||||
(default).
|
||||
""")
|
||||
]
|
||||
|
||||
osapi_opts = [
|
||||
cfg.IntOpt("max_limit",
|
||||
default=1000,
|
||||
min=0,
|
||||
deprecated_group="DEFAULT",
|
||||
deprecated_name="osapi_max_limit",
|
||||
help="""
|
||||
As a query can potentially return many thousands of items, you can limit the
|
||||
maximum number of items in a single response by setting this option.
|
||||
"""),
|
||||
cfg.StrOpt("compute_link_prefix",
|
||||
deprecated_group="DEFAULT",
|
||||
deprecated_name="osapi_compute_link_prefix",
|
||||
help="""
|
||||
This string is prepended to the normal URL that is returned in links to the
|
||||
OpenStack Compute API. If it is empty (the default), the URLs are returned
|
||||
unchanged.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any string, including an empty string (the default).
|
||||
"""),
|
||||
cfg.StrOpt("glance_link_prefix",
|
||||
deprecated_group="DEFAULT",
|
||||
deprecated_name="osapi_glance_link_prefix",
|
||||
help="""
|
||||
This string is prepended to the normal URL that is returned in links to
|
||||
Glance resources. If it is empty (the default), the URLs are returned
|
||||
unchanged.
|
||||
|
||||
Possible values:
|
||||
|
||||
* Any string, including an empty string (the default).
|
||||
"""),
|
||||
cfg.BoolOpt("instance_list_per_project_cells",
|
||||
default=False,
|
||||
help="""
|
||||
When enabled, this will cause the API to only query cell databases
|
||||
in which the tenant has mapped instances. This requires an additional
|
||||
(fast) query in the API database before each list, but also
|
||||
(potentially) limits the number of cell databases that must be queried
|
||||
to provide the result. If you have a small number of cells, or tenants
|
||||
are likely to have instances in all cells, then this should be
|
||||
False. If you have many cells, especially if you confine tenants to a
|
||||
small subset of those cells, this should be True.
|
||||
"""),
|
||||
cfg.StrOpt("instance_list_cells_batch_strategy",
|
||||
choices=("fixed", "distributed"),
|
||||
default="distributed",
|
||||
help="""
|
||||
This controls the method by which the API queries cell databases in
|
||||
smaller batches during large instance list operations. If batching is
|
||||
performed, a large instance list operation will request some fraction
|
||||
of the overall API limit from each cell database initially, and will
|
||||
re-request that same batch size as records are consumed (returned)
|
||||
from each cell as necessary. Larger batches mean less chattiness
|
||||
between the API and the database, but potentially more wasted effort
|
||||
processing the results from the database which will not be returned to
|
||||
the user. Any strategy will yield a batch size of at least 100 records,
|
||||
to avoid a user causing many tiny database queries in their request.
|
||||
|
||||
``distributed`` (the default) will attempt to divide the limit
|
||||
requested by the user by the number of cells in the system. This
|
||||
requires counting the cells in the system initially, which will not be
|
||||
refreshed until service restart or SIGHUP. The actual batch size will
|
||||
be increased by 10% over the result of ($limit / $num_cells).
|
||||
|
||||
``fixed`` will simply request fixed-size batches from each cell, as
|
||||
defined by ``instance_list_cells_batch_fixed_size``. If the limit is
|
||||
smaller than the batch size, the limit will be used instead. If you do
|
||||
not wish batching to be used at all, setting the fixed size equal to
|
||||
the ``max_limit`` value will cause only one request per cell database
|
||||
to be issued.
|
||||
|
||||
Possible values:
|
||||
|
||||
* distributed (default)
|
||||
* fixed
|
||||
|
||||
Related options:
|
||||
|
||||
* instance_list_cells_batch_fixed_size
|
||||
* max_limit
|
||||
"""),
|
||||
cfg.IntOpt("instance_list_cells_batch_fixed_size",
|
||||
min=100,
|
||||
default=100,
|
||||
help="""
|
||||
This controls the batch size of instances requested from each cell
|
||||
database if ``instance_list_cells_batch_strategy``` is set to ``fixed``.
|
||||
This integral value will define the limit issued to each cell every time
|
||||
a batch of instances is requested, regardless of the number of cells in
|
||||
the system or any other factors. Per the general logic called out in
|
||||
the documentation for ``instance_list_cells_batch_strategy``, the
|
||||
minimum value for this is 100 records per batch.
|
||||
|
||||
Related options:
|
||||
|
||||
* instance_list_cells_batch_strategy
|
||||
* max_limit
|
||||
"""),
|
||||
]
|
||||
|
||||
# NOTE(edleafe): I would like to import the value directly from
|
||||
# nova.compute.vm_states, but that creates a circular import. Since this value
|
||||
# is not likely to be changed, I'm copy/pasting it here.
|
||||
BUILDING = "building" # VM only exists in DB
|
||||
osapi_hide_opts = [
|
||||
cfg.ListOpt("hide_server_address_states",
|
||||
default=[BUILDING],
|
||||
deprecated_group="DEFAULT",
|
||||
deprecated_name="osapi_hide_server_address_states",
|
||||
deprecated_for_removal=True,
|
||||
deprecated_since="17.0.0",
|
||||
deprecated_reason="This option hide the server address in server "
|
||||
"representation for configured server states. "
|
||||
"Which makes GET server API controlled by this "
|
||||
"config options. Due to this config options, user "
|
||||
"would not be able to discover the API behavior on "
|
||||
"different clouds which leads to the interop issue.",
|
||||
help="""
|
||||
This option is a list of all instance states for which network address
|
||||
information should not be returned from the API.
|
||||
|
||||
Possible values:
|
||||
|
||||
A list of strings, where each string is a valid VM state, as defined in
|
||||
nova/compute/vm_states.py. As of the Newton release, they are:
|
||||
|
||||
* "active"
|
||||
* "building"
|
||||
* "paused"
|
||||
* "suspended"
|
||||
* "stopped"
|
||||
* "rescued"
|
||||
* "resized"
|
||||
* "soft-delete"
|
||||
* "deleted"
|
||||
* "error"
|
||||
* "shelved"
|
||||
* "shelved_offloaded"
|
||||
""")
|
||||
]
|
||||
|
||||
os_network_opts = [
|
||||
cfg.BoolOpt("use_neutron_default_nets",
|
||||
default=False,
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
When True, the TenantNetworkController will query the Neutron API to get the
|
||||
default networks to use.
|
||||
|
||||
Related options:
|
||||
|
||||
* neutron_default_tenant_id
|
||||
"""),
|
||||
cfg.StrOpt("neutron_default_tenant_id",
|
||||
default="default",
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
Tenant ID for getting the default network from Neutron API (also referred in
|
||||
some places as the 'project ID') to use.
|
||||
|
||||
Related options:
|
||||
|
||||
* use_neutron_default_nets
|
||||
"""),
|
||||
]
|
||||
|
||||
enable_inst_pw_opts = [
|
||||
cfg.BoolOpt("enable_instance_password",
|
||||
default=True,
|
||||
deprecated_group="DEFAULT",
|
||||
help="""
|
||||
Enables returning of the instance password by the relevant server API calls
|
||||
such as create, rebuild, evacuate, or rescue. If the hypervisor does not
|
||||
support password injection, then the password returned will not be correct,
|
||||
so if your hypervisor does not support password injection, set this to False.
|
||||
""")
|
||||
]
|
||||
|
||||
API_OPTS = (auth_opts +
|
||||
metadata_opts +
|
||||
file_opts +
|
||||
osapi_opts +
|
||||
osapi_hide_opts +
|
||||
os_network_opts +
|
||||
enable_inst_pw_opts)
|
||||
|
||||
|
||||
def register_opts(conf):
|
||||
conf.register_group(api_group)
|
||||
conf.register_opts(API_OPTS, group=api_group)
|
||||
conf.register_opts(api_opts, group=api_group)
|
||||
|
||||
|
||||
def list_opts():
|
||||
return {api_group: API_OPTS}
|
||||
return {api_group: api_opts}
|
||||
|
@ -18,45 +18,6 @@
|
||||
from oslo_config import cfg
|
||||
|
||||
base_options = [
|
||||
cfg.IntOpt(
|
||||
'password_length',
|
||||
default=12,
|
||||
min=0,
|
||||
help='Length of generated instance admin passwords.'),
|
||||
cfg.StrOpt(
|
||||
'instance_usage_audit_period',
|
||||
default='month',
|
||||
regex='(hour|month|day|year)(@([0-9]+))?',
|
||||
help='''
|
||||
Time period to generate instance usages for. It is possible to define optional
|
||||
offset to given period by appending @ character followed by a number defining
|
||||
offset.
|
||||
|
||||
Possible values:
|
||||
|
||||
* period, example: ``hour``, ``day``, ``month` or ``year``
|
||||
* period with offset, example: ``month@15`` will result in monthly audits
|
||||
starting on 15th day of month.
|
||||
'''),
|
||||
cfg.BoolOpt(
|
||||
'use_rootwrap_daemon',
|
||||
default=False,
|
||||
help='''
|
||||
Start and use a daemon that can run the commands that need to be run with
|
||||
root privileges. This option is usually enabled on nodes that run nova compute
|
||||
processes.
|
||||
'''),
|
||||
cfg.StrOpt(
|
||||
'rootwrap_config',
|
||||
default="/etc/nova/rootwrap.conf",
|
||||
help='''
|
||||
Path to the rootwrap configuration file.
|
||||
|
||||
Goal of the root wrapper is to allow a service-specific unprivileged user to
|
||||
run a number of actions as the root user in the safest manner possible.
|
||||
The configuration file used here must match the one defined in the sudoers
|
||||
entry.
|
||||
'''),
|
||||
cfg.StrOpt(
|
||||
'tempdir',
|
||||
help='Explicitly specify the temporary working directory.'),
|
||||
|
@ -1,169 +0,0 @@
|
||||
# needs:check_deprecation_status
|
||||
|
||||
|
||||
# Copyright 2015 OpenStack Foundation
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# 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
|
||||
|
||||
service_opts = [
|
||||
# TODO(johngarbutt) we need a better default and minimum, in a backwards
|
||||
# compatible way for report_interval
|
||||
cfg.IntOpt('report_interval',
|
||||
default=10,
|
||||
help="""
|
||||
Number of seconds indicating how frequently the state of services on a
|
||||
given hypervisor is reported. Nova needs to know this to determine the
|
||||
overall health of the deployment.
|
||||
|
||||
Related Options:
|
||||
|
||||
* service_down_time
|
||||
report_interval should be less than service_down_time. If service_down_time
|
||||
is less than report_interval, services will routinely be considered down,
|
||||
because they report in too rarely.
|
||||
"""),
|
||||
# TODO(johngarbutt) the code enforces the min value here, but we could
|
||||
# do to add some min value here, once we sort out report_interval
|
||||
cfg.IntOpt('service_down_time',
|
||||
default=60,
|
||||
help="""
|
||||
Maximum time in seconds since last check-in for up service
|
||||
|
||||
Each compute node periodically updates their database status based on the
|
||||
specified report interval. If the compute node hasn't updated the status
|
||||
for more than service_down_time, then the compute node is considered down.
|
||||
|
||||
Related Options:
|
||||
|
||||
* report_interval (service_down_time should not be less than report_interval)
|
||||
* scheduler.periodic_task_interval
|
||||
"""),
|
||||
cfg.BoolOpt('periodic_enable',
|
||||
default=True,
|
||||
help="""
|
||||
Enable periodic tasks.
|
||||
|
||||
If set to true, this option allows services to periodically run tasks
|
||||
on the manager.
|
||||
|
||||
In case of running multiple schedulers or conductors you may want to run
|
||||
periodic tasks on only one host - in this case disable this option for all
|
||||
hosts but one.
|
||||
"""),
|
||||
cfg.IntOpt('periodic_fuzzy_delay',
|
||||
default=60,
|
||||
min=0,
|
||||
help="""
|
||||
Number of seconds to randomly delay when starting the periodic task
|
||||
scheduler to reduce stampeding.
|
||||
|
||||
When compute workers are restarted in unison across a cluster,
|
||||
they all end up running the periodic tasks at the same time
|
||||
causing problems for the external services. To mitigate this
|
||||
behavior, periodic_fuzzy_delay option allows you to introduce a
|
||||
random initial delay when starting the periodic task scheduler.
|
||||
|
||||
Possible Values:
|
||||
|
||||
* Any positive integer (in seconds)
|
||||
* 0 : disable the random delay
|
||||
"""),
|
||||
cfg.ListOpt('enabled_apis',
|
||||
item_type=cfg.types.String(choices=['osapi_compute',
|
||||
'metadata']),
|
||||
default=['osapi_compute', 'metadata'],
|
||||
help="List of APIs to be enabled by default."),
|
||||
cfg.ListOpt('enabled_ssl_apis',
|
||||
default=[],
|
||||
help="""
|
||||
List of APIs with enabled SSL.
|
||||
|
||||
Nova provides SSL support for the API servers. enabled_ssl_apis option
|
||||
allows configuring the SSL support.
|
||||
"""),
|
||||
cfg.StrOpt('osapi_compute_listen',
|
||||
default="0.0.0.0",
|
||||
help="""
|
||||
IP address on which the OpenStack API will listen.
|
||||
|
||||
The OpenStack API service listens on this IP address for incoming
|
||||
requests.
|
||||
"""),
|
||||
cfg.PortOpt('osapi_compute_listen_port',
|
||||
default=8774,
|
||||
help="""
|
||||
Port on which the OpenStack API will listen.
|
||||
|
||||
The OpenStack API service listens on this port number for incoming
|
||||
requests.
|
||||
"""),
|
||||
cfg.IntOpt('osapi_compute_workers',
|
||||
min=1,
|
||||
help="""
|
||||
Number of workers for OpenStack API service. The default will be the number
|
||||
of CPUs available.
|
||||
|
||||
OpenStack API services can be configured to run as multi-process (workers).
|
||||
This overcomes the problem of reduction in throughput when API request
|
||||
concurrency increases. OpenStack API service will run in the specified
|
||||
number of processes.
|
||||
|
||||
Possible Values:
|
||||
|
||||
* Any positive integer
|
||||
* None (default value)
|
||||
"""),
|
||||
cfg.StrOpt('metadata_listen',
|
||||
default="0.0.0.0",
|
||||
help="""
|
||||
IP address on which the metadata API will listen.
|
||||
|
||||
The metadata API service listens on this IP address for incoming
|
||||
requests.
|
||||
"""),
|
||||
cfg.PortOpt('metadata_listen_port',
|
||||
default=8775,
|
||||
help="""
|
||||
Port on which the metadata API will listen.
|
||||
|
||||
The metadata API service listens on this port number for incoming
|
||||
requests.
|
||||
"""),
|
||||
cfg.IntOpt('metadata_workers',
|
||||
min=1,
|
||||
help="""
|
||||
Number of workers for metadata service. If not specified the number of
|
||||
available CPUs will be used.
|
||||
|
||||
The metadata service can be configured to run as multi-process (workers).
|
||||
This overcomes the problem of reduction in throughput when API request
|
||||
concurrency increases. The metadata service will run in the specified
|
||||
number of processes.
|
||||
|
||||
Possible Values:
|
||||
|
||||
* Any positive integer
|
||||
* None (default value)
|
||||
"""),
|
||||
]
|
||||
|
||||
|
||||
def register_opts(conf):
|
||||
conf.register_opts(service_opts)
|
||||
|
||||
|
||||
def list_opts():
|
||||
return {'DEFAULT': service_opts}
|
@ -1,63 +0,0 @@
|
||||
# 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 keystoneauth1 import loading as ks_loading
|
||||
from oslo_config import cfg
|
||||
|
||||
SERVICE_USER_GROUP = 'service_user'
|
||||
|
||||
service_user = cfg.OptGroup(
|
||||
SERVICE_USER_GROUP,
|
||||
title = 'Service token authentication type options',
|
||||
help = """
|
||||
Configuration options for service to service authentication using a service
|
||||
token. These options allow sending a service token along with the user's token
|
||||
when contacting external REST APIs.
|
||||
"""
|
||||
)
|
||||
|
||||
service_user_opts = [
|
||||
cfg.BoolOpt('send_service_user_token',
|
||||
default=False,
|
||||
help="""
|
||||
When True, if sending a user token to a REST API, also send a service token.
|
||||
|
||||
Nova often reuses the user token provided to the nova-api to talk to other REST
|
||||
APIs, such as Cinder, Glance and Neutron. It is possible that while the user
|
||||
token was valid when the request was made to Nova, the token may expire before
|
||||
it reaches the other service. To avoid any failures, and to make it clear it is
|
||||
Nova calling the service on the user's behalf, we include a service token along
|
||||
with the user token. Should the user's token have expired, a valid service
|
||||
token ensures the REST API request will still be accepted by the keystone
|
||||
middleware.
|
||||
"""),
|
||||
]
|
||||
|
||||
|
||||
def register_opts(conf):
|
||||
conf.register_group(service_user)
|
||||
conf.register_opts(service_user_opts, group=service_user)
|
||||
|
||||
ks_loading.register_session_conf_options(conf, SERVICE_USER_GROUP)
|
||||
ks_loading.register_auth_conf_options(conf, SERVICE_USER_GROUP)
|
||||
|
||||
|
||||
def list_opts():
|
||||
return {
|
||||
service_user: (
|
||||
service_user_opts +
|
||||
ks_loading.get_session_conf_options() +
|
||||
ks_loading.get_auth_common_conf_options() +
|
||||
ks_loading.get_auth_plugin_conf_options('password') +
|
||||
ks_loading.get_auth_plugin_conf_options('v2password') +
|
||||
ks_loading.get_auth_plugin_conf_options('v3password'))
|
||||
}
|
@ -1,221 +0,0 @@
|
||||
# Copyright 2015 OpenStack Foundation
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# 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
|
||||
|
||||
wsgi_group = cfg.OptGroup(
|
||||
'wsgi',
|
||||
title='WSGI Options',
|
||||
help='''
|
||||
Options under this group are used to configure WSGI (Web Server Gateway
|
||||
Interface). WSGI is used to serve API requests.
|
||||
''',
|
||||
)
|
||||
|
||||
ALL_OPTS = [
|
||||
cfg.StrOpt(
|
||||
'api_paste_config',
|
||||
default="api-paste.ini",
|
||||
deprecated_group='DEFAULT',
|
||||
help="""
|
||||
This option represents a file name for the paste.deploy config for nova-api.
|
||||
|
||||
Possible values:
|
||||
|
||||
* A string representing file name for the paste.deploy config.
|
||||
"""),
|
||||
# TODO(sfinucan): It is not possible to rename this to 'log_format'
|
||||
# yet, as doing so would cause a conflict if '[DEFAULT] log_format'
|
||||
# were used. When 'deprecated_group' is removed after Ocata, this
|
||||
# should be changed.
|
||||
cfg.StrOpt(
|
||||
'wsgi_log_format',
|
||||
default='%(client_ip)s "%(request_line)s" status: %(status_code)s'
|
||||
' len: %(body_length)s time: %(wall_seconds).7f',
|
||||
deprecated_group='DEFAULT',
|
||||
deprecated_for_removal=True,
|
||||
deprecated_since='16.0.0',
|
||||
deprecated_reason="""
|
||||
This option only works when running nova-api under eventlet, and
|
||||
encodes very eventlet specific pieces of information. Starting in Pike
|
||||
the preferred model for running nova-api is under uwsgi or apache
|
||||
mod_wsgi.
|
||||
""",
|
||||
help="""
|
||||
It represents a python format string that is used as the template to generate
|
||||
log lines. The following values can be formatted into it: client_ip,
|
||||
date_time, request_line, status_code, body_length, wall_seconds.
|
||||
|
||||
This option is used for building custom request loglines when running
|
||||
nova-api under eventlet. If used under uwsgi or apache, this option
|
||||
has no effect.
|
||||
|
||||
Possible values:
|
||||
|
||||
* '%(client_ip)s "%(request_line)s" status: %(status_code)s'
|
||||
'len: %(body_length)s time: %(wall_seconds).7f' (default)
|
||||
* Any formatted string formed by specific values.
|
||||
"""),
|
||||
cfg.StrOpt(
|
||||
'secure_proxy_ssl_header',
|
||||
deprecated_group='DEFAULT',
|
||||
help="""
|
||||
This option specifies the HTTP header used to determine the protocol scheme
|
||||
for the original request, even if it was removed by a SSL terminating proxy.
|
||||
|
||||
Possible values:
|
||||
|
||||
* None (default) - the request scheme is not influenced by any HTTP headers
|
||||
* Valid HTTP header, like ``HTTP_X_FORWARDED_PROTO``
|
||||
|
||||
WARNING: Do not set this unless you know what you are doing.
|
||||
|
||||
Make sure ALL of the following are true before setting this (assuming the
|
||||
values from the example above):
|
||||
|
||||
* Your API is behind a proxy.
|
||||
* Your proxy strips the X-Forwarded-Proto header from all incoming requests.
|
||||
In other words, if end users include that header in their requests, the proxy
|
||||
will discard it.
|
||||
* Your proxy sets the X-Forwarded-Proto header and sends it to API, but only
|
||||
for requests that originally come in via HTTPS.
|
||||
|
||||
If any of those are not true, you should keep this setting set to None.
|
||||
"""),
|
||||
cfg.StrOpt(
|
||||
'ssl_ca_file',
|
||||
deprecated_group='DEFAULT',
|
||||
help="""
|
||||
This option allows setting path to the CA certificate file that should be used
|
||||
to verify connecting clients.
|
||||
|
||||
Possible values:
|
||||
|
||||
* String representing path to the CA certificate file.
|
||||
|
||||
Related options:
|
||||
|
||||
* enabled_ssl_apis
|
||||
"""),
|
||||
cfg.StrOpt(
|
||||
'ssl_cert_file',
|
||||
deprecated_group='DEFAULT',
|
||||
help="""
|
||||
This option allows setting path to the SSL certificate of API server.
|
||||
|
||||
Possible values:
|
||||
|
||||
* String representing path to the SSL certificate.
|
||||
|
||||
Related options:
|
||||
|
||||
* enabled_ssl_apis
|
||||
"""),
|
||||
cfg.StrOpt(
|
||||
'ssl_key_file',
|
||||
deprecated_group='DEFAULT',
|
||||
help="""
|
||||
This option specifies the path to the file where SSL private key of API
|
||||
server is stored when SSL is in effect.
|
||||
|
||||
Possible values:
|
||||
|
||||
* String representing path to the SSL private key.
|
||||
|
||||
Related options:
|
||||
|
||||
* enabled_ssl_apis
|
||||
"""),
|
||||
cfg.IntOpt(
|
||||
'tcp_keepidle',
|
||||
min=0,
|
||||
default=600,
|
||||
deprecated_group='DEFAULT',
|
||||
help="""
|
||||
This option sets the value of TCP_KEEPIDLE in seconds for each server socket.
|
||||
It specifies the duration of time to keep connection active. TCP generates a
|
||||
KEEPALIVE transmission for an application that requests to keep connection
|
||||
active. Not supported on OS X.
|
||||
|
||||
Related options:
|
||||
|
||||
* keep_alive
|
||||
"""),
|
||||
cfg.IntOpt(
|
||||
'default_pool_size',
|
||||
min=0,
|
||||
default=1000,
|
||||
deprecated_group='DEFAULT',
|
||||
deprecated_name='wsgi_default_pool_size',
|
||||
help="""
|
||||
This option specifies the size of the pool of greenthreads used by wsgi.
|
||||
It is possible to limit the number of concurrent connections using this
|
||||
option.
|
||||
"""),
|
||||
cfg.IntOpt(
|
||||
'max_header_line',
|
||||
min=0,
|
||||
default=16384,
|
||||
deprecated_group='DEFAULT',
|
||||
help="""
|
||||
This option specifies the maximum line size of message headers to be accepted.
|
||||
max_header_line may need to be increased when using large tokens (typically
|
||||
those generated by the Keystone v3 API with big service catalogs).
|
||||
|
||||
Since TCP is a stream based protocol, in order to reuse a connection, the HTTP
|
||||
has to have a way to indicate the end of the previous response and beginning
|
||||
of the next. Hence, in a keep_alive case, all messages must have a
|
||||
self-defined message length.
|
||||
"""),
|
||||
cfg.BoolOpt(
|
||||
'keep_alive',
|
||||
default=True,
|
||||
deprecated_group='DEFAULT',
|
||||
deprecated_name='wsgi_keep_alive',
|
||||
help="""
|
||||
This option allows using the same TCP connection to send and receive multiple
|
||||
HTTP requests/responses, as opposed to opening a new one for every single
|
||||
request/response pair. HTTP keep-alive indicates HTTP connection reuse.
|
||||
|
||||
Possible values:
|
||||
|
||||
* True : reuse HTTP connection.
|
||||
* False : closes the client socket connection explicitly.
|
||||
|
||||
Related options:
|
||||
|
||||
* tcp_keepidle
|
||||
"""),
|
||||
cfg.IntOpt(
|
||||
'client_socket_timeout',
|
||||
min=0,
|
||||
default=900,
|
||||
deprecated_group='DEFAULT',
|
||||
help="""
|
||||
This option specifies the timeout for client connections' socket operations.
|
||||
If an incoming connection is idle for this number of seconds it will be
|
||||
closed. It indicates timeout on individual read/writes on the socket
|
||||
connection. To wait forever set to 0.
|
||||
"""),
|
||||
]
|
||||
|
||||
|
||||
def register_opts(conf):
|
||||
conf.register_group(wsgi_group)
|
||||
conf.register_opts(ALL_OPTS, group=wsgi_group)
|
||||
|
||||
|
||||
def list_opts():
|
||||
return {wsgi_group: ALL_OPTS}
|
Loading…
Reference in New Issue
Block a user