gosen 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ begin
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "gosen"
8
8
  gem.summary = %Q{A Ruby library for the Grid'5000 RESTful API}
9
- gem.description = %Q{Gosen is a Ruby library providing high-level operations using the Grid'5000 RESTful API, such as Kadeploy deployments}
9
+ gem.description = %Q{Gosen is a Ruby library providing high-level operations using the Grid'5000 RESTful API, such as Kadeploy deployments.}
10
10
  gem.email = "priteau@gmail.com"
11
11
  gem.homepage = "http://github.com/priteau/gosen"
12
12
  gem.authors = ["Pierre Riteau"]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -23,10 +23,10 @@ module Gosen
23
23
  @api_options = {}
24
24
  @logger = options.delete(:logger) || NullLogger.new
25
25
 
26
- @min_deployed_nodes = options[:min_deployed_nodes] || 1
26
+ @min_deployed_nodes = options.delete(:min_deployed_nodes) || 1
27
27
  raise Gosen::Error if @min_deployed_nodes > @nodes.length || @min_deployed_nodes < 0
28
28
 
29
- @max_deploy_runs = options[:max_deploy_runs] || 1
29
+ @max_deploy_runs = options.delete(:max_deploy_runs) || 1
30
30
  raise Gosen::Error if @max_deploy_runs < 1
31
31
 
32
32
  if options[:ssh_public_key]
@@ -16,10 +16,10 @@ module Gosen
16
16
  @nodes = nodes
17
17
  @good_nodes = []
18
18
  @bad_nodes = Array.new(@nodes)
19
- @api_options = {}
19
+ @api_options = options
20
20
 
21
- if options[:ssh_public_key]
22
- @api_options[:key] = @ssh_public_key = options[:ssh_public_key]
21
+ if @api_options[:ssh_public_key]
22
+ @api_options[:key] = @ssh_public_key = @api_options.delete(:ssh_public_key)
23
23
  end
24
24
  submit_deployment
25
25
  end
@@ -129,7 +129,7 @@ class TestDeployment < Test::Unit::TestCase
129
129
  @site_deployments.expects(:submit).with({ :environment => @environment, :nodes => @nodes }).returns(@deployment_resource)
130
130
  @min_deployed_nodes = 2
131
131
  @logger.expects(:info).with("Kadeploy run 1 with #{@nodes.length} nodes (0 already deployed, need #{@min_deployed_nodes} more)")
132
- @logger.expects(:info).with("Nodes deployed: paramount-1.rennes.grid5000.fr paramount-2.rennes.grid5000.fr")
132
+ @logger.expects(:info).with("Nodes deployed: paramount-1.rennes.grid5000.fr paramount-2.rennes.grid5000.fr")
133
133
  @logger.expects(:info).with("Had to run 1 kadeploy runs, deployed #{@deployment_result.length} nodes")
134
134
 
135
135
  @deployment = Gosen::Deployment.new(@site, @environment, @nodes, { :logger => @logger, :min_deployed_nodes => @min_deployed_nodes })
@@ -152,6 +152,17 @@ class TestDeployment < Test::Unit::TestCase
152
152
  }
153
153
  end
154
154
 
155
+ should 'pass extra API options to the deployment resource' do
156
+ @deployment_result = {
157
+ 'paramount-1.rennes.grid5000.fr' => { 'state' => 'OK' },
158
+ 'paramount-2.rennes.grid5000.fr' => { 'state' => 'OK' }
159
+ }
160
+ @deployment_resource.expects(:[]).with('result').returns(@deployment_result)
161
+ @site_deployments.expects(:submit).with({ :environment => @environment, :nodes => @nodes, :reformat_tmp => 'ext3' }).returns(@deployment_resource)
162
+ @deployment = Gosen::Deployment.new(@site, @environment, @nodes, { :reformat_tmp => 'ext3' })
163
+ @deployment.join
164
+ end
165
+
155
166
  should 'submit new deployment runs when needed' do
156
167
  @ssh_public_key = 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvwM1XBJCIMtAyQlweE7BVRtvgyKdwGTeYCI4AFlsTtti4y0Ipe5Hsygx3p7S0BHFiJsVZWDANMRwZ4tcjp8YnjnMkG2yp1jB1qgUf34t/MmEQL0KkoOk8tIIb28o7nTFYKO15mXJm9yBVS1JY8ozEfnA7s5hkrdnvM6h9Jv6VScp8C1XTKmpEy3sWOeUlmCkYftYSr1fLM/7qk9S2TnljA/CGiK9dq2mhJMjnDtulVrdpc1hbh+0oCzL6m2BfXX3v4q1ORml8o04oFeEYDN5qzZneL+FzK+YfJIidvsjZ9ziVTv+7Oy5ms4wvoKiUGNapP0v/meXXBU1KvFRof3VZQ== priteau@parallelogram.local'
157
168
  @deployment_resource1 = mock()
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 3
9
- version: 0.1.3
8
+ - 4
9
+ version: 0.1.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Pierre Riteau
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-29 00:00:00 -04:00
17
+ date: 2010-10-20 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -62,7 +62,7 @@ dependencies:
62
62
  version: 2.10.2
63
63
  type: :development
64
64
  version_requirements: *id003
65
- description: Gosen is a Ruby library providing high-level operations using the Grid'5000 RESTful API, such as Kadeploy deployments
65
+ description: Gosen is a Ruby library providing high-level operations using the Grid'5000 RESTful API, such as Kadeploy deployments.
66
66
  email: priteau@gmail.com
67
67
  executables: []
68
68