Class: Beaker::Host::PuppetConfigReader

Inherits:
Object
  • Object
show all
Defined in:
lib/beaker/host.rb

Overview

This class provides array syntax for using puppet –configprint on a host

Instance Method Summary collapse

Constructor Details

#initialize(host, command) ⇒ PuppetConfigReader

Returns a new instance of PuppetConfigReader.



17
18
19
20
# File 'lib/beaker/host.rb', line 17

def initialize(host, command)
  @host = host
  @command = command
end

Instance Method Details

#[](k) ⇒ Object



22
23
24
25
# File 'lib/beaker/host.rb', line 22

def [](k)
  cmd = PuppetCommand.new(@command, "--configprint #{k.to_s}")
  @host.exec(cmd).stdout.strip
end