Skip to content

Commit

Permalink
Merge pull request #22 from rightscale-cookbooks/ST-352_azure_volumes…
Browse files Browse the repository at this point in the history
…_proc_partitions

St 352 azure volumes proc partitions
  • Loading branch information
EfrainOlivares committed May 11, 2015
2 parents 809a555 + eccd0c3 commit 6f35a76
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.9
------

- Verify from OS perspective that volume has been attached.

v1.2.8
------

Expand Down
10 changes: 9 additions & 1 deletion libraries/provider_rightscale_volume.rb
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,15 @@ def attach_volume(volume_id, device)
scan_for_attachments if node['virtualization']['system'] == 'vmware'

# Determine the actual device name
(Set.new(get_current_devices) - current_devices).first
added_device = nil
Timeout::timeout(60) do
begin
sleep(1)
Chef::Log.info "Checking for added device."
added_device = (Set.new(get_current_devices) - current_devices).first
end until added_device
end
added_device
end

# Finds volumes using the given filters.
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.8'
version '1.2.9'

depends 'build-essential'

Expand Down
4 changes: 3 additions & 1 deletion spec/unit_test/provider_rightscale_volume_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 +626,11 @@ def create_test_volume_type(name, id, size, href)
end

describe "#attach_volume" do

it "should attach the volume to an instance" do
provider.stub(:find_volumes).and_return(array_of(volume_resource))
provider.stub(:get_current_devices).and_return(['device_1', 'device_2'])
# First call will return 1 device, second call will return 2 devices.
provider.stub(:get_current_devices).and_return(['device_1'], ['device_1', 'device_2'])

node.set[:virtualization][:system] = 'some_hypervisor'
node.set['cloud']['provider'] = 'some_cloud'
Expand Down

0 comments on commit 6f35a76

Please sign in to comment.