Class: QemuToolkit::Storadm

Inherits:
Clamp::Command
  • Object
show all
Defined in:
lib/qemu-toolkit/storadm.rb

Instance Method Summary collapse

Instance Method Details

#backendObject

Command backend to use during the processing of subcommands.



12
13
14
# File 'lib/qemu-toolkit/storadm.rb', line 12

def backend
  Config.backend
end

#executeObject

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



25
26
27
28
29
30
31
32
33
34
# 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) ⇒ Object

A factory method for VM storage.



18
19
20
# File 'lib/qemu-toolkit/storadm.rb', line 18

def storage(name)
  VMStorage.new(name, backend)
end