Use URIOpt

Replace StrOpt with URIOpt.
But 'serial_port_service_uri' in nova/conf/vmware.py
is excluded because it can be non URI format(*1).

*1: https://github.com/openstack/vmware-vspc/blob/master/README.rst

Change-Id: I595c55798b482009c42261c3603a58f82e89877c
Closes-Bug: #1599034
This commit is contained in:
Takashi NATSUME 2017-06-30 17:20:52 +09:00
parent 986e2f0e3a
commit 463fd7a11b
5 changed files with 25 additions and 7 deletions

View File

@ -32,8 +32,9 @@ If using the Ironic driver following options must be set:
""") """)
ironic_options = [ ironic_options = [
cfg.StrOpt( cfg.URIOpt(
'api_endpoint', 'api_endpoint',
schemes=['http', 'https'],
sample_default='http://ironic.example.org:6385/', sample_default='http://ironic.example.org:6385/',
help='URL override for the Ironic API endpoint.'), help='URL override for the Ironic API endpoint.'),
cfg.IntOpt( cfg.IntOpt(

View File

@ -29,7 +29,8 @@ Following options must be set to provide console access.
""") """)
mks_opts = [ mks_opts = [
cfg.StrOpt('mksproxy_base_url', cfg.URIOpt('mksproxy_base_url',
schemes=['http', 'https'],
default='http://127.0.0.1:6090/', default='http://127.0.0.1:6090/',
help=""" help="""
Location of MKS web console proxy Location of MKS web console proxy
@ -41,7 +42,8 @@ console access, WebMKS proxy should be installed and configured
Possible values: Possible values:
* Must be a valid URL of the form:``http://host:port/`` * Must be a valid URL of the form:``http://host:port/`` or
``https://host:port/``
"""), """),
cfg.BoolOpt('enabled', cfg.BoolOpt('enabled',
default=False, default=False,

View File

@ -46,7 +46,8 @@ Related options:
"""), """),
cfg.StrOpt('html5_proxy_base_url', cfg.URIOpt('html5_proxy_base_url',
schemes=['http', 'https'],
default='http://127.0.0.1:6083/', default='http://127.0.0.1:6083/',
help=""" help="""
The URL an end user would use to connect to the RDP HTML5 console proxy. The URL an end user would use to connect to the RDP HTML5 console proxy.
@ -68,7 +69,7 @@ Possible values:
* <scheme>://<ip-address>:<port-number>/ * <scheme>://<ip-address>:<port-number>/
The scheme must be identical to the scheme configured for the RDP HTML5 The scheme must be identical to the scheme configured for the RDP HTML5
console proxy service. console proxy service. It is ``http`` or ``https``.
The IP address must be identical to the address on which the RDP HTML5 The IP address must be identical to the address on which the RDP HTML5
console proxy service is listening. console proxy service is listening.

View File

@ -62,6 +62,8 @@ vmware_utils_opts = [
Set this value if affected by an increased network latency causing Set this value if affected by an increased network latency causing
repeated characters when typing in a remote console. repeated characters when typing in a remote console.
"""), """),
# NOTE(takashin): 'serial_port_service_uri' can be non URI format.
# See https://github.com/openstack/vmware-vspc/blob/master/README.rst
cfg.StrOpt('serial_port_service_uri', cfg.StrOpt('serial_port_service_uri',
help=""" help="""
Identifies the remote system where the serial port traffic will Identifies the remote system where the serial port traffic will
@ -76,14 +78,15 @@ Possible values:
* Any valid URI * Any valid URI
"""), """),
cfg.StrOpt('serial_port_proxy_uri', cfg.URIOpt('serial_port_proxy_uri',
schemes=['telnet', 'telnets'],
help=""" help="""
Identifies a proxy service that provides network access to the Identifies a proxy service that provides network access to the
serial_port_service_uri. serial_port_service_uri.
Possible values: Possible values:
* Any valid URI * Any valid URI (The scheme is 'telnet' or 'telnets'.)
Related options: Related options:
This option is ignored if serial_port_service_uri is not specified. This option is ignored if serial_port_service_uri is not specified.

View File

@ -0,0 +1,11 @@
---
upgrade:
- |
The type of following config options have been changed
from string to URI. They are checked whether they follow
the URI format or not and its scheme.
- ``api_endpoint`` in the ``ironic`` group
- ``mksproxy_base_url`` in the ``mks`` group
- ``html5_proxy_base_url`` in the ``rdp`` group
- ``serial_port_proxy_uri`` in the ``vmware`` group