only include metadata recipe if asked for

Attribute 'enabled_apis' allows for metadata to be selected or not.
Only include the api-metadata recipe if it's been asked for.

Closes-Bug: 1286300

Change-Id: Ib0f89c9ccf05892840c39af0223985e0553593e6
This commit is contained in:
Mark Vanderwiel 2014-03-13 12:56:24 -05:00
parent 206ea8c9ad
commit 92c94cbe02
5 changed files with 18 additions and 4 deletions

View File

@ -2,6 +2,9 @@
This file is used to list changes made in each version of cookbook-openstack-compute.
## 8.3.1
* Fixes including api-metadata recipe only when asked for (LP: 1286300)
## 8.3.0
* VMware compute driver support

View File

@ -331,7 +331,7 @@ License and Author
| **Copyright** | Copyright (c) 2012-2013, AT&T Services, Inc. |
| **Copyright** | Copyright (c) 2013, Craig Tracey |
| **Copyright** | Copyright (c) 2013, SUSE Linux GmbH |
| **Copyright** | Copyright (c) 2013, IBM, Corp. |
| **Copyright** | Copyright (c) 2013-2014, IBM, Corp. |
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -4,7 +4,7 @@ maintainer_email 'matt@opscode.com'
license 'Apache 2.0'
description 'The OpenStack Compute service Nova.'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '8.3.0'
version '8.3.1'
recipe 'openstack-compute::api-ec2', 'Installs AWS EC2 compatible API'
recipe 'openstack-compute::api-metadata', 'Installs the nova metadata package'

View File

@ -24,7 +24,9 @@ class ::Chef::Recipe # rubocop:disable Documentation
end
include_recipe 'openstack-compute::nova-common'
include_recipe 'openstack-compute::api-metadata'
if node['openstack']['compute']['enabled_apis'].include?('metadata')
include_recipe 'openstack-compute::api-metadata'
end
include_recipe 'openstack-compute::network'
platform_options = node['openstack']['compute']['platform']

View File

@ -11,10 +11,19 @@ describe 'openstack-compute::compute' do
include_context 'compute_stubs'
include_examples 'expect_runs_nova_common_recipe'
it 'runs api-metadata recipe' do
it 'includes api-metadata recipe' do
expect(chef_run).to include_recipe 'openstack-compute::api-metadata'
end
it 'does not include api-metadata recipe' do
chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
node = chef_run.node
node.set['openstack']['compute']['enabled_apis'] = 'ec2,osapi_compute'
chef_run.converge 'openstack-compute::compute'
expect(chef_run).not_to include_recipe 'openstack-compute::api-metadata'
end
it 'runs network recipe' do
expect(chef_run).to include_recipe 'openstack-compute::network'
end