class Beaker::Host::PuppetConfigReader
This class provides array syntax for using puppet –configprint on a host
Public Class Methods
Source
# File lib/beaker/host.rb, line 26 def initialize(host, command) @host = host @command = command end
Public Instance Methods
Source
# File lib/beaker/host.rb, line 39 def [](k) cmd = PuppetCommand.new(@command, "--configprint #{k}") @host.exec(cmd).stdout.strip end
Source
# File lib/beaker/host.rb, line 31 def has_key?(k) cmd = PuppetCommand.new(@command, '--configprint all') keys = @host.exec(cmd).stdout.split("\n").collect do |x| x[/^[^\s]+/] end keys.include?(k) end