Skip to content

Commit d2db654

Browse files
committed
fix: remove unnecessary check on output
1 parent 9b2a864 commit d2db654

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

lib/facter/puppetdb_version.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
setcode do
55
output = Facter::Core::Execution.execute('puppetdb --version')
6-
7-
if output.nil?
8-
nil
9-
else
10-
output.split(':').last.strip
11-
end
6+
output.split(':').last.strip
127
end
138
end

spec/unit/facter/puppetdb_version_spec.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,4 @@
2222

2323
expect(Facter.fact(:puppetdb_version).value).to be_nil
2424
end
25-
26-
it 'returns nil if puppetdb version output is nil' do
27-
allow(Facter::Util::Resolution).to receive(:which).with('puppetdb').and_return('/usr/bin/puppetdb')
28-
allow(Facter::Core::Execution).to receive(:execute).with('puppetdb --version').and_return(nil)
29-
30-
expect(Facter.fact(:puppetdb_version).value).to be_nil
31-
end
3225
end

0 commit comments

Comments
 (0)