fairchild-poolparty 1.3.5 → 1.3.17
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/bin/cloud +1 -0
- data/bin/cloud-compile +1 -0
- data/bin/cloud-misc +34 -0
- data/bin/cloud-show +13 -1
- data/bin/cloud-ssh +4 -1
- data/bin/cloud-thrift +32 -18
- data/config/jeweler.rb +5 -3
- data/examples/monitored_cloud.rb +1 -1
- data/examples/thrift/thrift_example.rb +8 -4
- data/examples/vmware.rb +10 -0
- data/lib/cloud_providers/cloud_provider.rb +9 -0
- data/lib/cloud_providers/cloud_provider_instance.rb +9 -4
- data/lib/cloud_providers/connections.rb +9 -5
- data/lib/cloud_providers/ec2/ec2.rb +42 -12
- data/lib/cloud_providers/ec2/ec2_helpers.rb +62 -5
- data/lib/cloud_providers/ec2/ec2_instance.rb +14 -1
- data/lib/cloud_providers/vmware/vmware.rb +3 -0
- data/lib/core/file.rb +12 -0
- data/lib/core/object.rb +1 -1
- data/lib/dependency_resolvers/base.rb +2 -9
- data/lib/dependency_resolvers/chef.rb +3 -3
- data/lib/keypair.rb +5 -3
- data/lib/poolparty.rb +3 -1
- data/lib/poolparty/base.rb +45 -22
- data/lib/poolparty/cloud.rb +70 -15
- data/lib/poolparty/default.rb +1 -0
- data/lib/poolparty/installer.rb +1 -1
- data/lib/poolparty/installers/ec2.rb +30 -16
- data/lib/poolparty/monitor.rb +25 -3
- data/lib/poolparty/plugin.rb +1 -5
- data/lib/poolparty/plugins/apache.rb +37 -11
- data/lib/poolparty/plugins/apache2/passenger_site.rb +1 -1
- data/lib/poolparty/plugins/apache2/virtual_host.rb +1 -0
- data/lib/poolparty/plugins/collectd.rb +29 -0
- data/lib/poolparty/plugins/collectd/templates/collectd.conf.erb +369 -0
- data/lib/poolparty/plugins/hermes.rb +101 -0
- data/lib/poolparty/pool.rb +14 -6
- data/lib/poolparty/resource.rb +20 -17
- data/lib/poolparty/resources/file.rb +2 -2
- data/lib/poolparty/resources/line.rb +1 -1
- data/lib/poolparty/resources/link.rb +2 -1
- data/lib/proto/command_interface_handler.rb +42 -7
- data/lib/proto/command_query_handler.rb +19 -0
- data/lib/proto/gen-py/cloudthrift/CommandInterface.pyc +0 -0
- data/lib/proto/gen-py/cloudthrift/__init__.pyc +0 -0
- data/lib/proto/gen-py/cloudthrift/constants.pyc +0 -0
- data/lib/proto/gen-py/cloudthrift/ttypes.pyc +0 -0
- data/lib/proto/gen-py/thrift/Thrift.pyc +0 -0
- data/lib/proto/gen-py/thrift/__init__.pyc +0 -0
- data/lib/proto/gen-py/thrift/protocol/TBinaryProtocol.pyc +0 -0
- data/lib/proto/gen-py/thrift/protocol/TProtocol.pyc +0 -0
- data/lib/proto/gen-py/thrift/protocol/__init__.pyc +0 -0
- data/lib/proto/gen-py/thrift/transport/TSocket.pyc +0 -0
- data/lib/proto/gen-py/thrift/transport/TTransport.pyc +0 -0
- data/lib/proto/gen-py/thrift/transport/__init__.pyc +0 -0
- data/lib/proto/poolparty.thrift +1 -0
- data/tasks/poolparty.rake +24 -0
- data/test/fixtures/clouds/fake_clouds.rb +2 -2
- data/test/fixtures/clouds/simple_cloud.rb +2 -2
- data/test/fixtures/resources/fake_plugin.rb +5 -0
- data/test/fixtures/resources/fake_subclassed_plugin.rb +19 -0
- data/test/lib/cloud_providers/ec2/ec2_instance_test.rb +17 -8
- data/test/lib/cloud_providers/ec2/ec2_test.rb +15 -11
- data/test/lib/core/array_test.rb +4 -0
- data/test/lib/dependency_resolvers/base_test.rb +1 -1
- data/test/lib/dependency_resolvers/chef/resources/remote_directory_test.rb +2 -2
- data/test/lib/dependency_resolvers/chef/resources/remote_file_test.rb +1 -1
- data/test/lib/dependency_resolvers/chef_test.rb +3 -3
- data/test/lib/poolparty/base_test.rb +1 -1
- data/test/lib/poolparty/cloud_test.rb +140 -33
- data/test/lib/poolparty/monitor_test.rb +29 -2
- data/test/lib/poolparty/plugins/apache_test.rb +5 -0
- data/test/lib/poolparty/pool_test.rb +3 -3
- data/test/lib/poolparty/resource_test.rb +14 -2
- data/test/lib/poolparty/resources/conditional_test.rb +1 -0
- data/test/lib/poolparty/resources/directory_test.rb +1 -1
- data/test/lib/poolparty/resources/file_test.rb +1 -1
- data/test/lib/poolparty/resources/user_test.rb +1 -1
- data/test/lib/proto/command_query_handler_test.rb +11 -0
- data/test/lib/provision/bootstrapper_test.rb +0 -25
- data/test/test_helper.rb +0 -1
- metadata +15 -4
@@ -3,14 +3,14 @@ require "#{File.dirname(__FILE__)}/../../test_helper"
|
|
3
3
|
class MonitorTest < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
|
-
@mon = PoolParty::Monitor.new(
|
6
|
+
@mon = PoolParty::Monitor.new("cpu-idle") do |c|
|
7
7
|
vote_for(:expand) if c > 0.8
|
8
8
|
configure if c < 0.1
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_monitor_initialize
|
13
|
-
assert_equal @mon.name, :cpu
|
13
|
+
assert_equal @mon.name, :'cpu-idle'
|
14
14
|
assert_equal Proc, @mon.monitor_block.class
|
15
15
|
end
|
16
16
|
|
@@ -27,4 +27,31 @@ class MonitorTest < Test::Unit::TestCase
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
def test_formatting_input
|
31
|
+
mon = PoolParty::Monitor.new("memory-used") {|c| long if c.length > 2}
|
32
|
+
mon.format(:to_s)
|
33
|
+
assert_equal({:long => []}, mon.run("hellllllllooooo world"))
|
34
|
+
|
35
|
+
mon = PoolParty::Monitor.new("memory-used") do |c|
|
36
|
+
long if c.length > 2
|
37
|
+
short if c.length < 2
|
38
|
+
end
|
39
|
+
mon.format(:to_a)
|
40
|
+
assert_equal({:long => []}, mon.run(%w(1 2 3 4)))
|
41
|
+
assert_equal({:short => []}, mon.run(%w(1)))
|
42
|
+
|
43
|
+
mon = PoolParty::Monitor.new("memory-used") do |saying, to|
|
44
|
+
if saying == "hello"
|
45
|
+
hello
|
46
|
+
else
|
47
|
+
goodbye
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
mon.format {|d|return *d.split(",")}
|
52
|
+
|
53
|
+
assert_equal({:hello => []}, mon.run("hello, world"))
|
54
|
+
assert_equal({:short => []}, mon.run("good day"))
|
55
|
+
end
|
56
|
+
|
30
57
|
end
|
@@ -11,9 +11,9 @@ class PoolTest < Test::Unit::TestCase
|
|
11
11
|
should "load the file with load_from_file on Pool" do
|
12
12
|
PoolParty::Pool.load_from_file(@filepath)
|
13
13
|
assert_equal PoolParty::Pool, pools["poolparty"].class
|
14
|
-
assert_equal PoolParty::Cloud, pools["poolparty"].clouds["
|
15
|
-
assert_equal "test_key", pools["poolparty"].clouds["
|
16
|
-
assert_equal "/etc/motd", pools["poolparty"].clouds["
|
14
|
+
assert_equal PoolParty::Cloud, pools["poolparty"].clouds["simple_cloud"].class
|
15
|
+
assert_equal "test_key", pools["poolparty"].clouds["simple_cloud"].keypair.basename
|
16
|
+
assert_equal "/etc/motd", pools["poolparty"].clouds["simple_cloud"].files.first.name
|
17
17
|
end
|
18
18
|
|
19
19
|
should "find_and_load_default_clouds_dot_rb in Pool" do
|
@@ -73,8 +73,6 @@ class ResourceTest < Test::Unit::TestCase
|
|
73
73
|
assert_equal @inst.print_variable(:a), ":a"
|
74
74
|
assert_equal @inst.print_variable({:a => "a"}), ":a => \"a\""
|
75
75
|
assert_equal @inst.print_variable(644), "644"
|
76
|
-
assert_equal @inst.print_variable("0755"), "0755"
|
77
|
-
assert_equal @inst.print_variable("755"), "0755"
|
78
76
|
assert_equal @inst.print_variable(@inst), @inst.to_s
|
79
77
|
assert_equal @inst.print_variable(nil), nil
|
80
78
|
end
|
@@ -147,4 +145,18 @@ class ResourceTest < Test::Unit::TestCase
|
|
147
145
|
end
|
148
146
|
end
|
149
147
|
|
148
|
+
def test_a_subclassed_resource_has_the_method_of_the_subclassed_resource
|
149
|
+
pool "oblong" do
|
150
|
+
cloud "piece" do
|
151
|
+
fake_plugin do
|
152
|
+
has_subclassed "box"
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
assert_equal PoolParty::Resources::FakePlugin, clouds["piece"].resources.first.class
|
158
|
+
assert_equal PoolParty::Resources::FakeSubclassedPlugin, clouds["piece"].resources.first.resources[0].class
|
159
|
+
assert_equal 1, clouds["piece"].resources.first.resources[0].resources.size
|
160
|
+
end
|
161
|
+
|
150
162
|
end
|
@@ -12,7 +12,7 @@ class DirectoryResourceTest < Test::Unit::TestCase
|
|
12
12
|
end
|
13
13
|
|
14
14
|
should "have the directory method denoted by has_method_name" do
|
15
|
-
str = "directory \"/etc/poolparty\" do\n action :create\n recursive true\n mode 0644\n owner \"root\"\n group \"root\"\nend\n"
|
15
|
+
str = "directory \"/etc/poolparty\" do\n action :create\n recursive true\n mode \"0644\"\n owner \"root\"\n group \"root\"\nend\n"
|
16
16
|
assert_equal str, @base.compile(@res)
|
17
17
|
end
|
18
18
|
|
@@ -13,7 +13,7 @@ class DirectoryResourceTest < Test::Unit::TestCase
|
|
13
13
|
end
|
14
14
|
|
15
15
|
should "have the template method denoted by has_method_name" do
|
16
|
-
str = "template \"/etc/poolparty/lyrics\" do\n source \"/etc/poolparty/lyrics.erb\"\n action :create\n backup 5\n mode 0644\n owner \"root\"\nend\n"
|
16
|
+
str = "template \"/etc/poolparty/lyrics\" do\n source \"/etc/poolparty/lyrics.erb\"\n action :create\n backup 5\n mode \"0644\"\n owner \"root\"\nend\n"
|
17
17
|
|
18
18
|
assert_equal str, @base.compile(@res)
|
19
19
|
assert_equal "I'm just a file, a lonely little file in the world", open(@cookboox_directory/"templates"/"default"/"etc"/"poolparty"/"lyrics.erb").read
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require "#{File.dirname(__FILE__)}/../../test_helper"
|
2
|
+
$:.unshift("#{File.dirname(__FILE__)}/../../../lib/proto")
|
3
|
+
require "command_query_handler"
|
4
|
+
|
5
|
+
class CommandQueryHandlerTest < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def test_has_run_query_command
|
8
|
+
assert CommandQueryHandler.respond_to?(:run_query)
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
@@ -16,29 +16,4 @@ class BootstrapperTest < Test::Unit::TestCase
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
context "configure_script" do
|
20
|
-
setup do
|
21
|
-
clear!
|
22
|
-
@filepath = fixtures_dir/"clouds/simple_cloud.rb"
|
23
|
-
@pool = PoolParty::Pool.load_from_file(@filepath)
|
24
|
-
@cloud = @pool.clouds[@pool.clouds.keys.first]
|
25
|
-
@outfile = test_dir/"configure_script.sh"
|
26
|
-
end
|
27
|
-
|
28
|
-
should "get the script for ubuntu" do
|
29
|
-
assert_equal File.expand_path(@outfile), Provision::Bootstrapper.configure_script(@cloud, :ubuntu, @outfile)
|
30
|
-
end
|
31
|
-
|
32
|
-
should "output some stuffies" do
|
33
|
-
assert_match /echo app > \/etc\/poolparty\/cloud_name/, open(@outfile).read
|
34
|
-
assert_match /echo poolparty > \/etc\/poolparty\/pool_name/, open(@outfile).read
|
35
|
-
end
|
36
|
-
|
37
|
-
should "raise an exception if the os isn't supported yet" do
|
38
|
-
assert_raises StandardError do
|
39
|
-
Provision::Bootstrapper.configure_script(@cloud, :non_existant_os)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
19
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fairchild-poolparty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ari Lerner
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2009-
|
14
|
+
date: 2009-09-23 00:00:00 -07:00
|
15
15
|
default_executable:
|
16
16
|
dependencies: []
|
17
17
|
|
@@ -26,6 +26,7 @@ executables:
|
|
26
26
|
- cloud-contract
|
27
27
|
- cloud-expand
|
28
28
|
- cloud-list
|
29
|
+
- cloud-misc
|
29
30
|
- cloud-osxcopy
|
30
31
|
- cloud-setup
|
31
32
|
- cloud-show
|
@@ -38,6 +39,7 @@ extensions: []
|
|
38
39
|
|
39
40
|
extra_rdoc_files:
|
40
41
|
- License.txt
|
42
|
+
- README.rdoc
|
41
43
|
files:
|
42
44
|
- License.txt
|
43
45
|
- README.rdoc
|
@@ -51,6 +53,7 @@ files:
|
|
51
53
|
- bin/cloud-contract
|
52
54
|
- bin/cloud-expand
|
53
55
|
- bin/cloud-list
|
56
|
+
- bin/cloud-misc
|
54
57
|
- bin/cloud-osxcopy
|
55
58
|
- bin/cloud-setup
|
56
59
|
- bin/cloud-show
|
@@ -133,6 +136,7 @@ files:
|
|
133
136
|
- lib/cloud_providers/vmware/vmware.rb
|
134
137
|
- lib/cloud_providers/vmware/vmware_instance.rb
|
135
138
|
- lib/core/array.rb
|
139
|
+
- lib/core/file.rb
|
136
140
|
- lib/core/hash.rb
|
137
141
|
- lib/core/integer.rb
|
138
142
|
- lib/core/module.rb
|
@@ -178,8 +182,11 @@ files:
|
|
178
182
|
- lib/poolparty/plugins/apache2/passenger_site.rb
|
179
183
|
- lib/poolparty/plugins/apache2/php5.rb
|
180
184
|
- lib/poolparty/plugins/apache2/virtual_host.rb
|
185
|
+
- lib/poolparty/plugins/collectd.rb
|
186
|
+
- lib/poolparty/plugins/collectd/templates/collectd.conf.erb
|
181
187
|
- lib/poolparty/plugins/git.rb
|
182
188
|
- lib/poolparty/plugins/git/git_repository.rb
|
189
|
+
- lib/poolparty/plugins/hermes.rb
|
183
190
|
- lib/poolparty/plugins/rails.rb
|
184
191
|
- lib/poolparty/plugins/rails/app.rb
|
185
192
|
- lib/poolparty/pool.rb
|
@@ -201,6 +208,7 @@ files:
|
|
201
208
|
- lib/poolparty/resources/user.rb
|
202
209
|
- lib/poolparty/resources/variable.rb
|
203
210
|
- lib/proto/command_interface_handler.rb
|
211
|
+
- lib/proto/command_query_handler.rb
|
204
212
|
- lib/proto/gen-erl/commandInterface_thrift.erl
|
205
213
|
- lib/proto/gen-erl/commandInterface_thrift.hrl
|
206
214
|
- lib/proto/gen-erl/poolparty_constants.hrl
|
@@ -268,6 +276,7 @@ files:
|
|
268
276
|
- test/fixtures/keys/test_pub_key
|
269
277
|
- test/fixtures/resources/fake_plugin.rb
|
270
278
|
- test/fixtures/resources/fake_resource.rb
|
279
|
+
- test/fixtures/resources/fake_subclassed_plugin.rb
|
271
280
|
- test/fixtures/resources/random_proc_file.rb
|
272
281
|
- test/fixtures/templates/apache_conf.erb
|
273
282
|
- test/fixtures/test_template.erb
|
@@ -328,6 +337,7 @@ files:
|
|
328
337
|
- test/lib/poolparty/resources/service_test.rb
|
329
338
|
- test/lib/poolparty/resources/user_test.rb
|
330
339
|
- test/lib/poolparty/resources/variable_test.rb
|
340
|
+
- test/lib/proto/command_query_handler_test.rb
|
331
341
|
- test/lib/provision/base_test.rb
|
332
342
|
- test/lib/provision/bootstrapper_test.rb
|
333
343
|
- test/test_helper.rb
|
@@ -1105,6 +1115,7 @@ files:
|
|
1105
1115
|
- vendor/gems/trollop/www/index.html
|
1106
1116
|
has_rdoc: false
|
1107
1117
|
homepage: http://poolpartyrb.com
|
1118
|
+
licenses:
|
1108
1119
|
post_install_message:
|
1109
1120
|
rdoc_options:
|
1110
1121
|
- --quiet
|
@@ -1130,10 +1141,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1130
1141
|
requirements: []
|
1131
1142
|
|
1132
1143
|
rubyforge_project:
|
1133
|
-
rubygems_version: 1.
|
1144
|
+
rubygems_version: 1.3.5
|
1134
1145
|
signing_key:
|
1135
1146
|
specification_version: 3
|
1136
|
-
summary: Self-healing, auto-scaling system administration, provisioning and maintaining tool that makes cloud computing
|
1147
|
+
summary: Self-healing, auto-scaling system administration, provisioning and maintaining tool that makes cloud computing easier.
|
1137
1148
|
test_files:
|
1138
1149
|
- test/test_helper.rb
|
1139
1150
|
- test/test_methods.rb
|