diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 45a8aa19..67c12577 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -25,6 +25,7 @@ Metrics/MethodLength: # SupportedStyles: nested, compact Style/ClassAndModuleChildren: Exclude: + - 'recipes/_nova_cell.rb' - 'recipes/api-metadata.rb' - 'recipes/api-os-compute.rb' - 'recipes/compute.rb' @@ -39,6 +40,7 @@ Style/Documentation: Exclude: - 'spec/**/*' - 'test/**/*' + - 'recipes/_nova_cell.rb' - 'recipes/api-metadata.rb' - 'recipes/api-os-compute.rb' - 'recipes/compute.rb' diff --git a/metadata.rb b/metadata.rb index be2ef401..1bd71973 100644 --- a/metadata.rb +++ b/metadata.rb @@ -6,7 +6,7 @@ source_url 'https://github.com/openstack/cookbook-openstack-compute' if respond_ license 'Apache 2.0' description 'The OpenStack Compute service Nova.' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '15.1.0' +version '15.2.0' chef_version '>= 12.5' if respond_to?(:chef_version) %w(ubuntu redhat centos).each do |os| diff --git a/recipes/_nova_cell.rb b/recipes/_nova_cell.rb index 29036320..448bed56 100644 --- a/recipes/_nova_cell.rb +++ b/recipes/_nova_cell.rb @@ -22,20 +22,20 @@ # and not called directly. It creates a basic cellv2 setup, which is required # from Ocata forward. +class ::Chef::Recipe + include ::Openstack +end + nova_user = node['openstack']['compute']['user'] nova_group = node['openstack']['compute']['group'] +db_user = node['openstack']['db']['compute_cell0']['username'] db_password = get_password('db', 'nova_cell0') -bind_db = node['openstack']['bind_service']['db'] -listen_address = if bind_db['interface'] - address_for bind_db['interface'] - else - listen_address = bind_db['host'] - end +uri = db_uri('compute_cell0', db_user, db_password) execute 'map cell0' do user nova_user group nova_group - command "nova-manage cell_v2 map_cell0 --database_connection mysql+pymysql://nova_cell0:#{db_password}@#{listen_address}/nova_cell0?charset=utf8" + command "nova-manage cell_v2 map_cell0 --database_connection #{uri}" not_if 'nova-manage cell_v2 list_cells | grep -q cell0' action :run end