fix bug setting device

The device set for the storage mount point was
hard-coded to /dev/$name. This value is only
valid when no device is supplied to the storage
xfs setup.

This commit updates it to use the target_device
which is either the device that was passed, or
/dev/$name if not device is specified.
This commit is contained in:
Dan Bode
2013-01-07 11:07:20 -08:00
parent 0ebf9d6143
commit b379804ca9
2 changed files with 5 additions and 5 deletions

View File

@@ -50,7 +50,7 @@ define swift::storage::xfs(
} }
swift::storage::mount { $name: swift::storage::mount { $name:
device => "/dev/${name}", device => $target_device,
mnt_base_dir => $mnt_base_dir, mnt_base_dir => $mnt_base_dir,
subscribe => Exec["mkfs-${name}"], subscribe => Exec["mkfs-${name}"],
loopback => $loopback, loopback => $loopback,

View File

@@ -7,14 +7,14 @@ describe 'swift::storage::xfs' do
describe 'when a device is specified' do describe 'when a device is specified' do
let :default_params do let :default_params do
{ {
:device => 'some_device', :device => "/dev/#{title}",
:byte_size => '1024', :byte_size => '1024',
:mnt_base_dir => '/srv/node', :mnt_base_dir => '/srv/node',
:loopback => false :loopback => false
} }
end end
[{:device => 'some_device'}, [{},
{ {
:device => 'some_device', :device => 'some_device',
:byte_size => 1, :byte_size => 1,
@@ -38,8 +38,8 @@ describe 'swift::storage::xfs' do
:require => 'Package[xfsprogs]' :require => 'Package[xfsprogs]'
)} )}
it { should contain_swift__storage__mount('foo').with( it { should contain_swift__storage__mount(title).with(
:device => '/dev/foo', :device => param_hash[:device],
:mnt_base_dir => param_hash[:mnt_base_dir], :mnt_base_dir => param_hash[:mnt_base_dir],
:loopback => param_hash[:loopback], :loopback => param_hash[:loopback],
:subscribe => 'Exec[mkfs-foo]' :subscribe => 'Exec[mkfs-foo]'