knife-eucalyptus 0.5.0 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/chef/knife/euca_base.rb +33 -27
- data/lib/chef/knife/euca_flavor_list.rb +3 -1
- data/lib/chef/knife/euca_image_list.rb +3 -1
- data/lib/chef/knife/euca_server_create.rb +8 -2
- data/lib/chef/knife/euca_server_delete.rb +3 -1
- data/lib/chef/knife/euca_server_list.rb +13 -2
- data/lib/knife-eucalyptus/version.rb +1 -1
- metadata +2 -2
data/lib/chef/knife/euca_base.rb
CHANGED
@@ -21,39 +21,45 @@ require 'chef/knife'
|
|
21
21
|
|
22
22
|
class Chef
|
23
23
|
class Knife
|
24
|
-
|
24
|
+
module EucaBase
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
end
|
26
|
+
# :nodoc:
|
27
|
+
# Would prefer to do this in a rational way, but can't be done b/c of
|
28
|
+
# Mixlib::CLI's design :(
|
29
|
+
def self.included(includer)
|
30
|
+
includer.class_eval do
|
32
31
|
|
33
|
-
|
32
|
+
deps do
|
33
|
+
require 'fog'
|
34
|
+
require 'net/ssh/multi'
|
35
|
+
require 'readline'
|
36
|
+
require 'chef/json_compat'
|
37
|
+
end
|
34
38
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
39
|
+
option :euca_access_key_id,
|
40
|
+
:short => "-A ID",
|
41
|
+
:long => "--euca-access-key-id KEY",
|
42
|
+
:description => "Your Eucalyptus Access Key ID",
|
43
|
+
:proc => Proc.new { |key| Chef::Config[:knife][:euca_access_key_id] = key }
|
40
44
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
45
|
+
option :euca_secret_access_key,
|
46
|
+
:short => "-K SECRET",
|
47
|
+
:long => "--euca-secret-access-key SECRET",
|
48
|
+
:description => "Your Eucalyptus API Secret Access Key",
|
49
|
+
:proc => Proc.new { |key| Chef::Config[:knife][:euca_secret_access_key] = key }
|
46
50
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
51
|
+
option :euca_api_endpoint,
|
52
|
+
:long => "--euca-api-endpoint ENDPOINT",
|
53
|
+
:description => "Your Eucalyptus API endpoint",
|
54
|
+
:default => "http://ecc.eucalyptus.com:8773/services/Eucalyptus",
|
55
|
+
:proc => Proc.new { |endpoint| Chef::Config[:knife][:euca_api_endpoint] = endpoint }
|
52
56
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
+
option :region,
|
58
|
+
:long => "--region REGION",
|
59
|
+
:description => "Your Eucalyptus region",
|
60
|
+
:proc => Proc.new { |region| Chef::Config[:knife][:region] = region }
|
61
|
+
end
|
62
|
+
end
|
57
63
|
|
58
64
|
def connection
|
59
65
|
@connection ||= begin
|
@@ -20,9 +20,15 @@ require 'chef/knife/euca_base'
|
|
20
20
|
|
21
21
|
class Chef
|
22
22
|
class Knife
|
23
|
-
class EucaServerCreate <
|
23
|
+
class EucaServerCreate < Knife
|
24
|
+
|
25
|
+
include Knife::EucaBase
|
24
26
|
|
25
27
|
deps do
|
28
|
+
require 'fog'
|
29
|
+
require 'net/ssh/multi'
|
30
|
+
require 'readline'
|
31
|
+
require 'chef/json_compat'
|
26
32
|
require 'chef/knife/bootstrap'
|
27
33
|
Chef::Knife::Bootstrap.load_deps
|
28
34
|
end
|
@@ -177,7 +183,7 @@ class Chef
|
|
177
183
|
print "\n#{ui.color("Waiting for sshd", :magenta)}"
|
178
184
|
|
179
185
|
print(".") until tcp_test_ssh(display_name) {
|
180
|
-
sleep @initial_sleep_delay ||=
|
186
|
+
sleep @initial_sleep_delay ||= 20
|
181
187
|
puts("done")
|
182
188
|
}
|
183
189
|
|
@@ -20,7 +20,9 @@ require 'chef/knife/euca_base'
|
|
20
20
|
|
21
21
|
class Chef
|
22
22
|
class Knife
|
23
|
-
class EucaServerList <
|
23
|
+
class EucaServerList < Knife
|
24
|
+
|
25
|
+
include Knife::EucaBase
|
24
26
|
|
25
27
|
banner "knife euca server list (options)"
|
26
28
|
|
@@ -41,7 +43,16 @@ class Chef
|
|
41
43
|
server_list << (server.flavor_id || "")
|
42
44
|
server_list << (server.image_id || "")
|
43
45
|
server_list << server.groups.join(", ")
|
44
|
-
server_list <<
|
46
|
+
server_list << begin
|
47
|
+
case server.state
|
48
|
+
when 'shutting-down'
|
49
|
+
ui.color(server.state, :red)
|
50
|
+
when 'pending'
|
51
|
+
ui.color(server.state, :yellow)
|
52
|
+
else
|
53
|
+
ui.color(server.state, :green)
|
54
|
+
end
|
55
|
+
end
|
45
56
|
end
|
46
57
|
puts ui.list(server_list, :columns_across, 6)
|
47
58
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: knife-eucalyptus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.5.
|
5
|
+
version: 0.5.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Seth Chisamore
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-07-
|
13
|
+
date: 2011-07-18 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|