Class: Caterer::Command::Lock

Inherits:
Server
  • Object
show all
Defined in:
lib/caterer/command/lock.rb

Instance Attribute Summary

Attributes inherited from Server

#env

Instance Method Summary collapse

Methods inherited from Server

#can_rsync?, #clean, #cleanup!, #config, #data, #detect_platform, #host, #initialize, #key, #keys, #lock, #lock!, #locked?, #name, #password, #platform_script, #port, #prepare!, #provision, #rsync, #run_action, #ssh, #ssh_opts, #ui, #unlock, #unlock!, #upload_directory, #username

Methods included from Util::Shell

#bash, #env, #env_string, #escape, #su

Constructor Details

This class inherits a constructor from Caterer::Server

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/lock.rb', line 5

def execute
  options = {}
  parser = OptionParser.new do |opts|
    opts.banner = "Usage: cater lock 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.lock
  end

  0
end