Class: Chef::Knife::ClodoServerStart

Inherits:
Chef::Knife show all
Includes:
ClodoBase
Defined in:
lib/chef/knife/clodo_server_start.rb

Instance Method Summary collapse

Methods included from ClodoBase

#connection, included, #locate_config_value

Instance Method Details

#runObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/chef/knife/clodo_server_start.rb', line 15

def run
  $stdout.sync = true

  if config[:all] then

    servers = connection.servers.all.select { |s|
      case s.state
      when 'is_running' then false
      when 'is_request' then false
      else true
      end
    }

    servers.each do |server|
      connection.start_server(server.id)
    end

  else

    @name_args.each do |server|
      connection.start_server(server)
    end

  end
end