Class: Caterer::Command::Unlock

Inherits:
Server show all
Defined in:
lib/caterer/command/unlock.rb

Instance Method Summary collapse

Methods inherited from Server

#add_server_opts, #image_list, #init_server, #target_servers, #with_target_servers

Methods inherited from Base

#initialize, #parse_options

Constructor Details

This class inherits a constructor from Caterer::Command::Base

Instance Method Details

#executeObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/caterer/command/unlock.rb', line 5

def execute
  options = {}
  parser = OptionParser.new do |opts|
    opts.banner = "Usage: cater unlock HOST [options]"
  end

  add_server_opts(parser, options)

  # Parse the options
  argv = parse_options(parser, true)
  return if not argv

  with_target_servers(argv, options) do |server|
    server.unlock
  end

  0
end