class Imagemaster3000::Actions::Remove

Attributes

file[RW]

Public Class Methods

new(file) click to toggle source
# File lib/imagemaster3000/actions/remove.rb, line 6
def initialize(file)
  @file = file
  logger.debug "Created action #{inspect}"
end

Public Instance Methods

run(image_file) click to toggle source
# File lib/imagemaster3000/actions/remove.rb, line 11
def run(image_file)
  logger.debug "Running 'remove' action with argument #{file.inspect} on file #{image_file.inspect}"
  Imagemaster3000::Utils::CommandExecutioner.execute Imagemaster3000::Settings[:'binaries-guestfish'],
                                                     '-a',
                                                     image_file,
                                                     '-i',
                                                     'rm',
                                                     file
rescue Imagemaster3000::Errors::CommandExecutionError => ex
  raise Imagemaster3000::Errors::ActionError, ex
end