From 463fd7a11baa7618e14e355b162c06f3ccf2c2b2 Mon Sep 17 00:00:00 2001 From: Takashi NATSUME Date: Fri, 30 Jun 2017 17:20:52 +0900 Subject: [PATCH] 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 --- nova/conf/ironic.py | 3 ++- nova/conf/mks.py | 6 ++++-- nova/conf/rdp.py | 5 +++-- nova/conf/vmware.py | 7 +++++-- releasenotes/notes/bug-1599034-35ca4dea612d8fdb.yaml | 11 +++++++++++ 5 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/bug-1599034-35ca4dea612d8fdb.yaml diff --git a/nova/conf/ironic.py b/nova/conf/ironic.py index 23fdd84b36f3..756e544ea2a7 100644 --- a/nova/conf/ironic.py +++ b/nova/conf/ironic.py @@ -32,8 +32,9 @@ If using the Ironic driver following options must be set: """) ironic_options = [ - cfg.StrOpt( + cfg.URIOpt( 'api_endpoint', + schemes=['http', 'https'], sample_default='http://ironic.example.org:6385/', help='URL override for the Ironic API endpoint.'), cfg.IntOpt( diff --git a/nova/conf/mks.py b/nova/conf/mks.py index 6e4971750aae..1703f5f24047 100644 --- a/nova/conf/mks.py +++ b/nova/conf/mks.py @@ -29,7 +29,8 @@ Following options must be set to provide console access. """) mks_opts = [ - cfg.StrOpt('mksproxy_base_url', + cfg.URIOpt('mksproxy_base_url', + schemes=['http', 'https'], default='http://127.0.0.1:6090/', help=""" Location of MKS web console proxy @@ -41,7 +42,8 @@ console access, WebMKS proxy should be installed and configured 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', default=False, diff --git a/nova/conf/rdp.py b/nova/conf/rdp.py index 93b5096f2bbe..4d014be98976 100644 --- a/nova/conf/rdp.py +++ b/nova/conf/rdp.py @@ -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/', help=""" The URL an end user would use to connect to the RDP HTML5 console proxy. @@ -68,7 +69,7 @@ Possible values: * ://:/ 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 console proxy service is listening. diff --git a/nova/conf/vmware.py b/nova/conf/vmware.py index 8a8b8ddf5d01..a633868fa557 100644 --- a/nova/conf/vmware.py +++ b/nova/conf/vmware.py @@ -62,6 +62,8 @@ vmware_utils_opts = [ Set this value if affected by an increased network latency causing 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', help=""" Identifies the remote system where the serial port traffic will @@ -76,14 +78,15 @@ Possible values: * Any valid URI """), - cfg.StrOpt('serial_port_proxy_uri', + cfg.URIOpt('serial_port_proxy_uri', + schemes=['telnet', 'telnets'], help=""" Identifies a proxy service that provides network access to the serial_port_service_uri. Possible values: -* Any valid URI +* Any valid URI (The scheme is 'telnet' or 'telnets'.) Related options: This option is ignored if serial_port_service_uri is not specified. diff --git a/releasenotes/notes/bug-1599034-35ca4dea612d8fdb.yaml b/releasenotes/notes/bug-1599034-35ca4dea612d8fdb.yaml new file mode 100644 index 000000000000..cae2f77a3bb1 --- /dev/null +++ b/releasenotes/notes/bug-1599034-35ca4dea612d8fdb.yaml @@ -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