Class: RSpecSystem::Helpers::Facter

Inherits:
RSpecSystem::Helper
  • Object
show all
Defined in:
lib/rspec-system-puppet/helpers/facter.rb

Overview

Helper object behind RSpecSystemPuppet::Helpers#facter

Instance Method Summary collapse

Instance Method Details

#executeRSpecSystem::Result

Gathers new results by executing the resource action

Returns:

  • (RSpecSystem::Result)

    raw execution results



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rspec-system-puppet/helpers/facter.rb', line 14

def execute
  node = opts[:node]
  sh = shell :c => "facter -y", :n => node

  rd = sh.to_hash
  rd[:facts] = begin
    YAML::load(sh.stdout)
  rescue
  end

  rd
end