Skip to content

Commit

Permalink
Merge pull request #13 from autrejacoupa/patch-1
Browse files Browse the repository at this point in the history
fix_device_mapping should return nil where fixed_device does not match /dev/xvd. This should fix creating ephemeral for m2.2xlarge.
  • Loading branch information
douglaswth committed Feb 20, 2014
2 parents 23e7724 + 6b53595 commit de2d586
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions libraries/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def self.fix_device_mapping(devices, node_block_devices)
fixed_device
else
Chef::Log.warn "could not find ephemeral device: #{device}"
nil
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion spec/ephemeral_lvm_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

it "skips the devices that cannot be mapped" do
stub_const("Chef::Log", Logger.new('/dev/null'))
Chef::Log.should_receive(:warn).with("could not find ephemeral device: /dev/sdb")
Chef::Log.should_receive(:warn).with("could not find ephemeral device: /dev/sdb").and_return([])

expect(
EphemeralLvm::Helper.fix_device_mapping(["/dev/sda", "/dev/sdb"], ["xvda"])
).to eq(["/dev/xvda"])
Expand Down

0 comments on commit de2d586

Please sign in to comment.