Skip to content

Commit fe7ddc1

Browse files
authored
Merge pull request #72 from tvpartytonight/PA-5966
Stop using legacy facts
2 parents b7f9a82 + 32f78af commit fe7ddc1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/puppet/provider/zfs/zfs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def exists?
4242

4343
# On FreeBSD zoned is called jailed
4444
def container_property
45-
case Facter.value(:operatingsystem)
45+
case Facter.value('os.name')
4646
when 'FreeBSD'
4747
:jailed
4848
else

spec/unit/provider/zfs/zfs_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
describe 'zoned' do
113113
context 'on FreeBSD' do
114114
before(:each) do
115-
allow(Facter).to receive(:value).with(:operatingsystem).and_return('FreeBSD')
115+
allow(Facter).to receive(:value).with('os.name').and_return('FreeBSD')
116116
end
117117
it "gets 'jailed' property" do
118118
expect(provider).to receive(:zfs).with(:get, '-H', '-o', 'value', :jailed, name).and_return("value\n")
@@ -127,7 +127,7 @@
127127

128128
context 'when not running FreeBSD' do
129129
before(:each) do
130-
allow(Facter).to receive(:value).with(:operatingsystem).and_return('Solaris')
130+
allow(Facter).to receive(:value).with('os.name').and_return('Solaris')
131131
end
132132
it "gets 'zoned' property" do
133133
expect(provider).to receive(:zfs).with(:get, '-H', '-o', 'value', :zoned, name).and_return("value\n")

0 commit comments

Comments
 (0)