class Cloudkeeper::CommandExecutioner

Public Class Methods

execute(*args) click to toggle source
# File lib/cloudkeeper/command_executioner.rb, line 4
def execute(*args)
  command = Mixlib::ShellOut.new(*args, timeout: Cloudkeeper::Settings[:'external-tools-execution-timeout'])
  logger.debug "Executing command: #{command.command.inspect}"
  command.run_command

  if command.error?
    raise Cloudkeeper::Errors::CommandExecutionError, "Command #{command.command.inspect} terminated with an error: " \
                                                      "#{command.stderr}"
  end

  command.stdout
end
list_archive(archive) click to toggle source
# File lib/cloudkeeper/command_executioner.rb, line 17
def list_archive(archive)
  execute('tar', '-t', '-f', archive).lines.map(&:chomp)
end