Method: Bolt::Transport::LXD::Connection#execute

Defined in:
lib/bolt/transport/lxd/connection.rb

#execute(command) ⇒ Object



59
60
61
62
63
64
65
66
# File 'lib/bolt/transport/lxd/connection.rb', line 59

def execute(command)
  lxc_command = %w[lxc exec]
  lxc_command += @env_vars if @env_vars
  lxc_command += %W[#{container_id} -- sh -c #{Shellwords.shellescape(command)}]

  @logger.trace { "Executing: #{lxc_command.join(' ')}" }
  Open3.popen3(lxc_command.join(' '))
end