osapi_compute_link_prefix should not be set by default

Correctly default osapi_compute_link_prefix to nil.
Added osapi_glance_link_prefix for completeness.
Created attributes for these for flexibility.
Updated specs to cover these and other misc keys.

Change-Id: Ic2fd79fc74dedb649b08c451ded678ac1d1ed310
Closes-Bug: #1418583
This commit is contained in:
Mark Vanderwiel 2015-04-08 13:31:39 -05:00
parent a29ad4be74
commit 0d57f7097f
5 changed files with 33 additions and 2 deletions

View File

@ -127,6 +127,8 @@ Openstack Compute attributes are in the attribute namespace ["openstack"]["compu
* `openstack["compute"]["config"]["force_raw_images"]` - Convert all images used as backing files for instances to raw (we default to false)
* `openstack["compute"]["config"]["allow_same_net_traffic"]` - Disable security groups for internal networks (we default to true)
* `openstack["compute"]["config"]["osapi_max_limit"]` - The maximum number of items returned in a single response from a collection resource (default is 1000)
* `openstack["compute"]["config"]["osapi_compute_link_prefix"]` - Base URL that will be presented to users in links to the OpenStack Compute API (default is nil)
* `openstack["compute"]["config"]["osapi_glance_link_prefix"]` - Base URL that will be presented to users in links to glance resources(default is nil)
* `openstack["compute"]["config"]["cpu_allocation_ratio"]` - Virtual CPU to Physical CPU allocation ratio (default 16.0)
* `openstack["compute"]["config"]["ram_allocation_ratio"]` - Virtual RAM to Physical RAM allocation ratio (default 1.5)
* `openstack["compute"]["config"]["snapshot_image_format"]` - Snapshot image format (valid options are : raw, qcow2, vmdk, vdi [we default to qcow2]).

View File

@ -299,7 +299,15 @@ default['openstack']['compute']['config']['availability_zone'] = 'nova'
default['openstack']['compute']['config']['default_schedule_zone'] = 'nova'
default['openstack']['compute']['config']['force_raw_images'] = false
default['openstack']['compute']['config']['allow_same_net_traffic'] = true
# The maximum number of items returned in a single
# response from a collection resource
default['openstack']['compute']['config']['osapi_max_limit'] = 1000
# Base URL that will be presented to users in links
# to the OpenStack Compute API
default['openstack']['compute']['config']['osapi_compute_link_prefix'] = nil
# Base URL that will be presented to users in links
# to glance resources
default['openstack']['compute']['config']['osapi_glance_link_prefix'] = nil
default['openstack']['compute']['config']['cpu_allocation_ratio'] = 16.0
default['openstack']['compute']['config']['ram_allocation_ratio'] = 1.5
default['openstack']['compute']['config']['disk_allocation_ratio'] = 1.0

View File

@ -159,7 +159,6 @@ template '/etc/nova/nova.conf' do
glance_api_port: image_endpoint.port,
iscsi_helper: platform_options['iscsi_helper'],
scheduler_default_filters: node['openstack']['compute']['scheduler']['default_filters'].join(','),
osapi_compute_link_prefix: compute_api_endpoint.to_s,
network_endpoint: network_endpoint,
neutron_admin_password: neutron_admin_password,
neutron_metadata_proxy_shared_secret: neutron_metadata_proxy_shared_secret,

View File

@ -137,6 +137,23 @@ describe 'openstack-compute::nova-common' do
end
end
it 'has default misc config attributes defaults set' do
[/^force_raw_images=false$/,
/^allow_same_net_traffic=true$/,
/^osapi_max_limit=1000$/,
/^start_guests_on_host_boot=false$/,
/^resume_guests_state_on_host_boot=true$/].each do |line|
expect(chef_run).to render_config_file(file.name).with_section_content('DEFAULT', line)
end
end
it 'has default misc config attributes defaults not set' do
[/^osapi_compute_link_prefix=/,
/^osapi_glance_link_prefix=/].each do |line|
expect(chef_run).not_to render_config_file(file.name).with_section_content('DEFAULT', line)
end
end
it 'does not have compute driver attribute default_ephemeral_format set by default' do
expect(chef_run).not_to render_file(file.name).with_content(/^default_ephemeral_format=$/)
end

View File

@ -208,7 +208,12 @@ osapi_max_limit=<%= node["openstack"]["compute"]["config"]["osapi_max_limit"] %>
# the HTTPS scheme. Setting this overrides the default and allows
# URIs returned in the various links collections to contain the proper
# HTTPS endpoint.
osapi_compute_link_prefix = <%= @osapi_compute_link_prefix %>
<% if node["openstack"]["compute"]["config"]["osapi_compute_link_prefix"] %>
osapi_compute_link_prefix=<%= node["openstack"]["compute"]["config"]["osapi_compute_link_prefix"] -%>
<% end -%>
<% if node["openstack"]["compute"]["config"]["osapi_glance_link_prefix"] %>
osapi_glance_link_prefix=<%= node["openstack"]["compute"]["config"]["osapi_glance_link_prefix"] -%>
<% end -%>
start_guests_on_host_boot=<%= node["openstack"]["compute"]["config"]["start_guests_on_host_boot"] %>
resume_guests_state_on_host_boot=<%= node["openstack"]["compute"]["config"]["resume_guests_state_on_host_boot"] %>
allow_resize_to_same_host=<%= node["openstack"]["compute"]["config"]["allow_resize_to_same_host"] %>