Skip to content

Commit cda5e84

Browse files
David HollingerDavid Hollinger
authored andcommitted
MODULES-4753 Update provider and tests
Update the provider changes to be more inline with how the tests are designed. Tests have been added. Gitignore updated to contain the .fixtures/modules and .fixtures/manifests folders.
1 parent 29f1d64 commit cda5e84

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
.*.swp
33
Gemfile.lock
44
.bundle/
5+
.fixtures/modules
6+
.fixtures/manifests

lib/puppet/provider/filesystem/lvm.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Puppet::Type.type(:filesystem).provide :lvm do
22
desc "Manages filesystem of a logical volume"
33

4-
commands :blkid => 'blkid', :swapon => 'swapon'
4+
commands :blkid => 'blkid'
55

66
def create
77
mkfs(@resource[:fs_type], @resource[:name])
@@ -46,7 +46,9 @@ def mkfs(fs_type, name)
4646

4747
execute mkfs_cmd
4848
if fs_type == 'swap'
49-
swapon(name)
49+
swap_cmd = ["swapon"]
50+
swap_cmd << name
51+
execute swap_cmd
5052
end
5153
end
5254

spec/unit/puppet/provider/filesystem/lvm_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
@resource.expects(:[]).with(:options)
4040
@provider.expects(:execute).with(['mkswap', '/dev/myvg/mylv'])
4141
@resource.expects(:[]).with(:mkfs_cmd)
42+
@provider.expects(:execute).with(['swapon', '/dev/myvg/mylv'])
4243
@provider.create
4344
end
4445
it "should create an ext4 journal correctly" do

0 commit comments

Comments
 (0)