Parent

Class/Module Index [+]

Quicksearch

HammerCLIForeman::SSH::Command

Constants

DEFAULT_PER_PAGE

Public Instance Methods

execute() click to toggle source
# File lib/hammer_cli_foreman/ssh.rb, line 30
def execute
  puts _("About to execute: #{command} as user #{user}\n" +
  "on the following #{hosts.size} hosts: #{host_names.join(', ')}")

  unless prompt? == false || ask(_('Continue, (y/N)')).downcase == 'y'
    warn _('aborting per user request')
    return HammerCLI::EX_OK
  end

  ssh_options = { :user => user, :auth_methods => ['publickey'] }
  ssh_options[:keys] = [identity_file] unless identity_file.to_s.empty?

  Net::SSH::Multi.start(:on_error => :warn) do |session|
    targets.each { |s| session.use s, ssh_options }
    session.exec command
    session.loop
  end

  HammerCLI::EX_OK
end
request_params() click to toggle source
# File lib/hammer_cli_foreman/ssh.rb, line 23
def request_params
  params             = super
  params['search']   ||= search
  params['per_page'] ||= HammerCLI::Settings.get(:ui, :per_page) || DEFAULT_PER_PAGE
  params
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.