Skip to content

Commit a7a6572

Browse files
committed
downcase puppet_flavor fact
1 parent b43a016 commit a7a6572

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/facter/puppet_flavor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
confine { Facter::Core::Execution.which('puppet') }
55
setcode do
66
output = Facter::Core::Execution.execute('puppet --help')
7-
output.split[-2] if output
7+
output.split[-2].downcase if output
88
end
99
end
1010

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
$puppet_major = regsubst($facts['puppetversion'], '^(\d+)\..*$', '\1')
265265

266266
# Add support for OpenVox. Default to puppet if nothing is installed yet
267-
$puppet_flavor = pick($facts['puppet_flavor'], 'puppet').downcase()
267+
$puppet_flavor = pick($facts['puppet_flavor'], 'puppet')
268268
$puppetserver_flavor = regsubst("${puppet_flavor}server", 'openvox', 'openvox-')
269269

270270
$server_package = if ($facts['os']['family'] =~ /(FreeBSD|DragonFly)/) {

spec/unit/puppet/facter/puppet_flavor_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ module Creates, installs and searches for modules on the Puppet Forge
9292
puppet_string
9393
end
9494
end
95-
it { expect(Facter.fact(:puppet_flavor).value).to eq('Puppet') }
95+
it { expect(Facter.fact(:puppet_flavor).value).to eq('puppet') }
9696
end
9797
context 'with OpenVox' do
9898
before do
9999
allow(Facter::Core::Execution).to receive(:execute).with('puppet --help') do
100100
openvox_string
101101
end
102102
end
103-
it { expect(Facter.fact(:puppet_flavor).value).to eq('OpenVox') }
103+
it { expect(Facter.fact(:puppet_flavor).value).to eq('openvox') }
104104
end
105105
end
106106
end

0 commit comments

Comments
 (0)