Add attributes for swift_enable_snet & swift_store_region
- Add default["openstack"]["image"]["api"]["swift"]["enable_snet"] attribute - Add default["openstack"]["image"]["api"]["swift"]["store_region"] attribute - Set defaults such that the end result doesn't change, but attributes can be overridden. - Add tests for these 2 attributes - Add README.md entries for these 2 attributes Change-Id: I8dd10a9731f996ebe6b064d2552f9cc5a1bf468d Closes-Bug: #1274937
This commit is contained in:
parent
f7b7072d04
commit
58b828eae2
|
@ -116,6 +116,8 @@ Attributes for the Image service are in the ['openstack']['image'] namespace.
|
|||
* `openstack['image']['api']['swift']['store_container']` - Set the container used by glance to store images and snapshots. Defaults to "glance"
|
||||
* `openstack['image']['api']['swift']['store_large_object_size']` - Set the size at which glance starts to chunnk files. Defaults to "200" MB
|
||||
* `openstack['image']['api']['swift']['store_large_object_chunk_size']` - Set the chunk size for glance. Defaults to "200" MB
|
||||
* `openstack['image']['api']['swift']['enable_snet']` - Set whether to use ServiceNET to communicate with the Swift Storage servers. (Rackspace specific option)
|
||||
* `openstack['image']['api']['swift']['store_region']` - The region of the swift endpoint to be used for single tenant. This setting is only necessary if the tenant has multiple swift endpoints.
|
||||
* `openstack['image']['api']['rbd']['rbd_store_ceph_conf']` - Default location of ceph.conf
|
||||
* `openstack['image']['api']['rbd']['rbd_store_user']` - User for connecting to ceph store
|
||||
* `openstack['image']['api']['rbd']['rbd_store_pool']` - RADOS pool for images
|
||||
|
|
|
@ -69,6 +69,8 @@ default['openstack']['image']['api']['bind_interface'] = nil
|
|||
default['openstack']['image']['api']['swift']['container'] = 'glance'
|
||||
default['openstack']['image']['api']['swift']['large_object_size'] = '200'
|
||||
default['openstack']['image']['api']['swift']['large_object_chunk_size'] = '200'
|
||||
default['openstack']['image']['api']['swift']['enable_snet'] = 'False'
|
||||
default['openstack']['image']['api']['swift']['store_region'] = nil
|
||||
default['openstack']['image']['api']['cache']['image_cache_max_size'] = '10737418240'
|
||||
|
||||
# Directory for the Image Cache
|
||||
|
|
|
@ -128,6 +128,24 @@ describe 'openstack-image::api' do
|
|||
expect(chef_run).to render_file(file.name).with_content(
|
||||
/^show_image_direct_url = True$/)
|
||||
end
|
||||
|
||||
it 'sets swift_enable_snet as specified' do
|
||||
node.set['openstack']['image']['api']['swift']['enable_snet'] = 'True'
|
||||
expect(chef_run).to render_file(file.name).with_content(
|
||||
/^swift_enable_snet = True$/)
|
||||
end
|
||||
|
||||
it 'doesnt set swift_store_region if nil' do
|
||||
node.set['openstack']['image']['api']['swift']['store_region'] = nil
|
||||
expect(chef_run).to_not render_file(file.name).with_content(
|
||||
/^swift_store_region/)
|
||||
end
|
||||
|
||||
it 'does set swift_store_region if not nil' do
|
||||
node.set['openstack']['image']['api']['swift']['store_region'] = 'test_region'
|
||||
expect(chef_run).to render_file(file.name).with_content(
|
||||
/^swift_store_region = test_region$/)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'qpid' do
|
||||
|
|
|
@ -193,7 +193,10 @@ swift_store_large_object_chunk_size = <%= node["openstack"]["image"]["api"]["swi
|
|||
# To use ServiceNET for authentication, prefix hostname of
|
||||
# `swift_store_auth_address` with 'snet-'.
|
||||
# Ex. https://example.com/v1.0/ -> https://snet-example.com/v1.0/
|
||||
swift_enable_snet = False
|
||||
swift_enable_snet = <%= node["openstack"]["image"]["api"]["swift"]["enable_snet"] %>
|
||||
<% unless node["openstack"]["image"]["api"]["swift"]["store_region"].nil? %>
|
||||
swift_store_region = <%= node["openstack"]["image"]["api"]["swift"]["store_region"] %>
|
||||
<% end %>
|
||||
|
||||
# ============ S3 Store Options =============================
|
||||
|
||||
|
|
Loading…
Reference in New Issue