class QemuToolkit::Storadm

Public Instance Methods

_execute() click to toggle source
# File lib/qemu-toolkit/storadm.rb, line 43
def _execute
  storage(template).clone(name, version)
end
backend() click to toggle source

Command backend to use during the processing of subcommands.

# File lib/qemu-toolkit/storadm.rb, line 12
def backend
  Config.backend
end
execute() click to toggle source

Main execute method - delegates to _execute in the subcommands. This handles transforming Ruby errors into simple shell errors.

# File lib/qemu-toolkit/storadm.rb, line 25
def execute
  backend.verbose = verbose?

  _execute
rescue => error
  raise if verbose? || $rspec_executing

  $stderr.puts error.to_s
  exit 1
end
storage(name) click to toggle source

A factory method for VM storage.

# File lib/qemu-toolkit/storadm.rb, line 18
def storage(name)
  VMStorage.new(name, backend)
end