From 91e38deac076016c1cca14a6b0397db644cd73e3 Mon Sep 17 00:00:00 2001 From: Lopaka Delp Date: Wed, 15 Apr 2015 16:28:27 -0700 Subject: [PATCH 1/2] ST-249 Change 'rackspace-ng' to 'rackspace' --- libraries/provider_rightscale_volume.rb | 6 +++--- spec/unit_test/provider_rightscale_volume_spec.rb | 8 ++++---- test/cookbooks/test-rightscale_volume/recipes/test.rb | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libraries/provider_rightscale_volume.rb b/libraries/provider_rightscale_volume.rb index bbb5c17..9d8920d 100644 --- a/libraries/provider_rightscale_volume.rb +++ b/libraries/provider_rightscale_volume.rb @@ -133,7 +133,7 @@ def action_delete @new_resource.updated_by_last_action(true) Chef::Log.info " Successfully deleted volume '#{@current_resource.nickname}'" else - if ['rackspace-ng', 'openstack'].include?(node['cloud']['provider']) + if ['rackspace', 'openstack'].include?(node['cloud']['provider']) Chef::Log.info "Volume '#{@current_resource.nickname}' was not deleted!" delete_device_hash else @@ -296,7 +296,7 @@ def initialize_api_client(options = {}) # @raise [Timeout::Error] if volume creation takes longer than the timeout value # def create_volume(name, size, description = "", snapshot_id = nil, options = {}) - if (size < 100 && node['cloud']['provider'] == "rackspace-ng") + if (size < 100 && node['cloud']['provider'] == "rackspace") raise "Minimum volume size supported by this cloud is 100 GB." end @@ -376,7 +376,7 @@ def create_volume(name, size, description = "", snapshot_id = nil, options = {}) # def get_volume_type_href(cloud, size, options = {}) case cloud - when 'rackspace-ng' + when 'rackspace' # Set SATA as the default volume type for Rackspace Open Cloud options[:volume_type] = 'SATA' unless options[:volume_type] when 'cloudstack' diff --git a/spec/unit_test/provider_rightscale_volume_spec.rb b/spec/unit_test/provider_rightscale_volume_spec.rb index 7fff822..a329355 100644 --- a/spec/unit_test/provider_rightscale_volume_spec.rb +++ b/spec/unit_test/provider_rightscale_volume_spec.rb @@ -402,7 +402,7 @@ def run_action(action_sym) context "on Rackspace Open Cloud" do it "should not raise execption" do - node.set['cloud']['provider'] = 'rackspace-ng' + node.set['cloud']['provider'] = 'rackspace' expect { run_action(:delete) }.to_not raise_error @@ -472,7 +472,7 @@ def run_action(action_sym) end context "given the name and size for the volume" do - context "the cloud provider is not rackspace-ng, cloudstack, or vsphere" do + context "the cloud provider is not rackspace, cloudstack, or vsphere" do it "should create the volume" do node.set['cloud']['provider'] = 'some_cloud' client_stub.should_receive(:volumes).and_return(volume_resource) @@ -529,8 +529,8 @@ def create_test_volume_type(name, id, size, href) end end - context 'when the cloud is rackspace-ng' do - let(:cloud) { 'rackspace-ng' } + context 'when the cloud is rackspace' do + let(:cloud) { 'rackspace' } let(:sata_href) { '/api/clouds/2374/volume_types/FDQ9LAJ83V4QT' } before(:each) do diff --git a/test/cookbooks/test-rightscale_volume/recipes/test.rb b/test/cookbooks/test-rightscale_volume/recipes/test.rb index c4c3b10..6076da8 100644 --- a/test/cookbooks/test-rightscale_volume/recipes/test.rb +++ b/test/cookbooks/test-rightscale_volume/recipes/test.rb @@ -24,7 +24,7 @@ class Chef::Resource include_recipe 'rightscale_volume::default' # Set minimum volume size to 100GB for Rackspace Open Clouds (cloud-specific feature) -volume_size = node[:cloud][:provider] == 'rackspace-ng' ? 100 : 1 +volume_size = node[:cloud][:provider] == 'rackspace' ? 100 : 1 # Set the volume name with the current UNIX timestamp so that multiple test runs # do not overlap each other in case of failures @@ -234,7 +234,7 @@ class Chef::Resource block do if is_volume_deleted?(test_volume_2) Chef::Log.info 'TESTING action_delete -- PASSED' - elsif ['rackspace-ng', 'openstack'].include?(node['cloud']['provider']) + elsif ['rackspace', 'openstack'].include?(node['cloud']['provider']) Chef::Log.info 'TESTING action_delete -- SKIPPED cannot delete volume if it has dependent snapshots' else raise 'TESTING action_delete -- FAILED' From 8c5644f452f3074fc3933363d533035589f2f2af Mon Sep 17 00:00:00 2001 From: Lopaka Delp Date: Mon, 20 Apr 2015 11:15:14 -0700 Subject: [PATCH 2/2] ST-249 Bump version to 1.2.8 and update CHANGELOG.md. --- CHANGELOG.md | 5 +++++ metadata.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 949afad..39cc82d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ rightscale_volume Cookbook CHANGELOG This file is used to list changes made in each version of the rightscale_volume cookbook. +v1.2.8 +------ + +- Use correct Rackspace cloud name. + v1.2.7 ------ diff --git a/metadata.rb b/metadata.rb index e6750dd..062ac99 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ license 'Apache 2.0' description 'Provides a resource to manage volumes on any cloud RightScale supports.' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '1.2.7' +version '1.2.8' depends 'build-essential'