From b988a773a0e89685ab3377c0cd829bf61b9868d1 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Tue, 8 Nov 2016 15:14:05 -0700 Subject: [PATCH] Deprecate rabbitmq connection parameters The rabbitmq connection parameters have been deprecated in favor of the transport_url setting. Change-Id: Ia0c5b5072431bbc186c8b96b7f034e68e9248af3 Related-Bug: #1625198 --- manifests/init.pp | 72 +++++++++++-------- ...n-params-deprecation-930b59055a8a868f.yaml | 6 ++ spec/acceptance/nova_wsgi_apache_spec.rb | 4 +- 3 files changed, 49 insertions(+), 33 deletions(-) create mode 100644 releasenotes/notes/rabbit-connection-params-deprecation-930b59055a8a868f.yaml diff --git a/manifests/init.pp b/manifests/init.pp index c613a77be..6edda7660 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -73,30 +73,6 @@ # (optional) List of addresses for api servers. # Defaults to 'http://localhost:9292' # -# [*rabbit_host*] -# (optional) Location of rabbitmq installation. (string value) -# Defaults to $::os_service_default -# -# [*rabbit_hosts*] -# (optional) List of clustered rabbit servers. (string value) -# Defaults to $::os_service_default -# -# [*rabbit_port*] -# (optional) Port for rabbitmq instance. (port value) -# Defaults to $::os_service_default -# -# [*rabbit_password*] -# (optional) Password used to connect to rabbitmq. (string value) -# Defaults to $::os_service_default -# -# [*rabbit_userid*] -# (optional) User used to connect to rabbitmq. (string value) -# Defaults to $::os_service_default -# -# [*rabbit_virtual_host*] -# (optional) The RabbitMQ virtual host. (string value) -# Defaults to $::os_service_default -# # [*rabbit_use_ssl*] # (optional) Boolean. Connect over SSL for RabbitMQ. (boolean value) # Defaults to $::os_service_default @@ -427,6 +403,30 @@ # memcached server IP's:Memcached Port. # Defaults to undef # +# [*rabbit_host*] +# (optional) Location of rabbitmq installation. (string value) +# Defaults to $::os_service_default +# +# [*rabbit_hosts*] +# (optional) List of clustered rabbit servers. (string value) +# Defaults to $::os_service_default +# +# [*rabbit_port*] +# (optional) Port for rabbitmq instance. (port value) +# Defaults to $::os_service_default +# +# [*rabbit_password*] +# (optional) Password used to connect to rabbitmq. (string value) +# Defaults to $::os_service_default +# +# [*rabbit_userid*] +# (optional) User used to connect to rabbitmq. (string value) +# Defaults to $::os_service_default +# +# [*rabbit_virtual_host*] +# (optional) The RabbitMQ virtual host. (string value) +# Defaults to $::os_service_default +# class nova( $ensure_package = 'present', $database_connection = undef, @@ -448,12 +448,6 @@ class nova( # these glance params should be optional # this should probably just be configured as a glance client $glance_api_servers = 'http://localhost:9292', - $rabbit_host = $::os_service_default, - $rabbit_hosts = $::os_service_default, - $rabbit_password = $::os_service_default, - $rabbit_port = $::os_service_default, - $rabbit_userid = $::os_service_default, - $rabbit_virtual_host = $::os_service_default, $rabbit_use_ssl = $::os_service_default, $rabbit_heartbeat_timeout_threshold = $::os_service_default, $rabbit_heartbeat_rate = $::os_service_default, @@ -524,6 +518,12 @@ class nova( $purge_config = false, # DEPRECATED PARAMETERS $memcached_servers = undef, + $rabbit_host = $::os_service_default, + $rabbit_hosts = $::os_service_default, + $rabbit_password = $::os_service_default, + $rabbit_port = $::os_service_default, + $rabbit_userid = $::os_service_default, + $rabbit_virtual_host = $::os_service_default, ) inherits nova::params { include ::nova::deps @@ -540,6 +540,18 @@ class nova( if $memcached_servers { warning('nova::memcached_servers is deprecated, use nova::keystone::authtoken::memcached_servers instead.') } + + if !is_service_default($rabbit_host) or + !is_service_default($rabbit_hosts) or + !is_service_default($rabbit_password) or + !is_service_default($rabbit_port) or + !is_service_default($rabbit_userid) or + !is_service_default($rabbit_virtual_host) { + warning("nova::rabbit_host, nova::rabbit_hosts, nova::rabbit_password, \ +nova::rabbit_port, nova::rabbit_userid and nova::rabbit_virtual_host are \ +deprecated. Please use nova::default_transport_url instead.") + } + if $use_ssl { if !$cert_file { fail('The cert_file parameter is required when use_ssl is set to true') diff --git a/releasenotes/notes/rabbit-connection-params-deprecation-930b59055a8a868f.yaml b/releasenotes/notes/rabbit-connection-params-deprecation-930b59055a8a868f.yaml new file mode 100644 index 000000000..9a6b30426 --- /dev/null +++ b/releasenotes/notes/rabbit-connection-params-deprecation-930b59055a8a868f.yaml @@ -0,0 +1,6 @@ +--- +deprecations: + - nova::rabbit_host, nova::rabbit_hosts, nova::rabbit_password, + nova::rabbit_port, nova::rabbit_userid and + nova::rabbit_virtual_host are deprecated. + nova::default_transport_url should be used instead. diff --git a/spec/acceptance/nova_wsgi_apache_spec.rb b/spec/acceptance/nova_wsgi_apache_spec.rb index a5c1dd090..76d18df92 100644 --- a/spec/acceptance/nova_wsgi_apache_spec.rb +++ b/spec/acceptance/nova_wsgi_apache_spec.rb @@ -31,12 +31,10 @@ describe 'basic nova' do class { '::nova': database_connection => 'mysql+pymysql://nova:a_big_secret@127.0.0.1/nova?charset=utf8', api_database_connection => 'mysql+pymysql://nova_api:a_big_secret@127.0.0.1/nova_api?charset=utf8', - rabbit_userid => 'nova', - rabbit_password => 'an_even_bigger_secret', + default_transport_url => 'rabbit://nova:an_even_bigger_secret@127.0.0.1:5672/', image_service => 'nova.image.glance.GlanceImageService', glance_api_servers => 'localhost:9292', debug => true, - rabbit_host => '127.0.0.1', } class { '::nova::db::mysql': password => 'a_big_secret',