Skip to content

Commit f0b3318

Browse files
authored
Merge pull request #87 from OpenVoxProject/backport-63-to-7.x
Add implementation fact to agent and server
2 parents c3395ce + 9f38cce commit f0b3318

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

lib/puppet/node/facts.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def save(instance, key = nil, options={})
2727
attr_accessor :name, :values, :timestamp
2828

2929
def add_local_facts
30+
values["implementation"] = Puppet.implementation
3031
values["clientcert"] = Puppet.settings[:certname]
3132
values["clientversion"] = Puppet.version.to_s
3233
values["clientnoop"] = Puppet.settings[:noop]

lib/puppet/node/server_facts.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ class Puppet::Node::ServerFacts
44
def self.load
55
server_facts = {}
66

7+
# Add implementation information
8+
server_facts["implementation"] = Puppet.implementation
9+
710
# Add our server Puppet Enterprise version, if available.
811
pe_version_file = '/opt/puppetlabs/server/pe_version'
912
if File.readable?(pe_version_file) and !File.zero?(pe_version_file)

lib/puppet/version.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
module Puppet
99
PUPPETVERSION = '7.36.1'
10+
IMPLEMENTATION = 'openvox'
1011

1112
##
1213
# version is a public API method intended to always provide a fast and
@@ -73,6 +74,10 @@ def self.version=(version)
7374
@puppet_version = version
7475
end
7576

77+
def self.implementation
78+
IMPLEMENTATION
79+
end
80+
7681
##
7782
# read_version_file reads the content of the "VERSION" file that lives in the
7883
# same directory as this source code file.

spec/unit/node/facts_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
@facts.add_local_facts
3636
expect(@facts.values["environment"]).to eq("foo")
3737
end
38+
39+
it "adds the implementation fact" do
40+
@facts.add_local_facts
41+
expect(@facts.values).to include("implementation")
42+
expect(@facts.values["implementation"]).to eq("openvox")
43+
end
3844
end
3945

4046
describe "when sanitizing facts" do

0 commit comments

Comments
 (0)