diff --git a/lib/rspec-puppet/support.rb b/lib/rspec-puppet/support.rb index 692bfe92a..ad0f8a4cf 100644 --- a/lib/rspec-puppet/support.rb +++ b/lib/rspec-puppet/support.rb @@ -301,8 +301,7 @@ def server_facts_hash server_facts['serverversion'] = Puppet.version.to_s # And then add the server name and IP - { 'servername' => 'fqdn', - 'serverip' => 'ipaddress' }.each do |var, fact| + { 'servername' => 'networking.fqdn', 'serverip' => 'networking.ip' }.each do |var, fact| if (value = Puppet.runtime[:facter].value(fact)) server_facts[var] = value else @@ -311,8 +310,8 @@ def server_facts_hash end if server_facts['servername'].nil? - host = Puppet.runtime[:facter].value(:hostname) - server_facts['servername'] = if (domain = Puppet.runtime[:facter].value(:domain)) + host = Puppet.runtime[:facter].value('networking.hostname') + server_facts['servername'] = if (domain = Puppet.runtime[:facter].value('networking.domain')) [host, domain].join('.') else host diff --git a/spec/classes/server_facts_spec.rb b/spec/classes/server_facts_spec.rb index 66d73135b..a71b2ff8e 100644 --- a/spec/classes/server_facts_spec.rb +++ b/spec/classes/server_facts_spec.rb @@ -5,7 +5,7 @@ describe 'server_facts' do let(:facts) do { - ipaddress: '192.168.1.10' + 'networking' => { 'ip' => '192.168.1.10' } } end let(:node) { 'test123.test.com' }