cloudkeeper-one 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e196faafd597eb04749900d0018efa45acd9e3be
4
- data.tar.gz: 88db4d7e7caa6ad5acf67aab4ccb6496b49bbee9
3
+ metadata.gz: df65ccc84ad1470254b4357721efc6fddcc4850a
4
+ data.tar.gz: bdce17f386d3d7b22c741a6a5c09064f458e70db
5
5
  SHA512:
6
- metadata.gz: 80b3135b1e03af1077dd9b096bfa9ced5939311451fb8905dc7c9ef87ce591404a2e7dc9cf02013e9e792e07d4937fee9c8b056ccb198048ddd5afac8afa31fa
7
- data.tar.gz: 1272ad092a1608fe0d8f549f4c98661acb22aced948d3b2e514ddfb498310719973b3e8b46d00716d74b38085eaaac39eb99ea3cf603a7bcc415c1092f7ffca7
6
+ metadata.gz: 47ac56b1226cb92cee84530f2e866e9d36e85d2becc89b92f17e626780a1ed2f7dfac1e3f30db0ff4e8649b70d1dac4079a174020567a22f2e42750a55f3249e
7
+ data.tar.gz: ba6c9b0390209e8b013f9120c2244597655f46fe19fa0a5d9c0f17f548b31b2033d38fd132ea677504a4d11ccdda18b86ed5a45ba38417335a7efb5262d785a7
@@ -42,11 +42,11 @@ Gem::Specification.new do |spec|
42
42
  spec.add_development_dependency 'pry-byebug', '~> 3.4'
43
43
  spec.add_development_dependency 'vcr', '~> 3.0'
44
44
  spec.add_development_dependency 'webmock', '~> 3.0'
45
- spec.add_development_dependency 'grpc-tools', '~> 1.0'
45
+ spec.add_development_dependency 'grpc-tools', '>= 1.1', '<= 1.2.5'
46
46
 
47
47
  spec.add_runtime_dependency 'thor', '~> 0.19'
48
48
  spec.add_runtime_dependency 'yell', '~> 2.0'
49
- spec.add_runtime_dependency 'grpc', '~> 1.0'
49
+ spec.add_runtime_dependency 'grpc', '>= 1.1', '<= 1.2.5'
50
50
  spec.add_runtime_dependency 'settingslogic', '~> 2.0'
51
51
  spec.add_runtime_dependency 'activesupport', '>= 4.0', '< 6.0'
52
52
  spec.add_runtime_dependency 'tilt', '~> 2.0'
@@ -1,31 +1,31 @@
1
1
  module Cloudkeeper
2
2
  module One
3
3
  module ApplianceActions
4
- module Removal
5
- def remove_appliance(appliance_id)
4
+ module Discard
5
+ def discard_appliance(appliance_id)
6
6
  logger.debug "Removing templates for appliance #{appliance_id.inspect}"
7
- remove_templates :find_by_appliance_id, appliance_id
7
+ discard_templates :find_by_appliance_id, appliance_id
8
8
  logger.debug "Removing images for appliance #{appliance_id.inspect}"
9
- remove_images :find_by_appliance_id, appliance_id
9
+ discard_images :find_by_appliance_id, appliance_id
10
10
  end
11
11
 
12
- def remove_image_list(image_list_id)
12
+ def discard_image_list(image_list_id)
13
13
  logger.debug "Removing templates for image list #{image_list_id.inspect}"
14
- remove_templates :find_by_image_list_id, image_list_id
14
+ discard_templates :find_by_image_list_id, image_list_id
15
15
  logger.debug "Removing images for image list #{image_list_id.inspect}"
16
- remove_images :find_by_image_list_id, image_list_id
16
+ discard_images :find_by_image_list_id, image_list_id
17
17
  end
18
18
 
19
- def remove_expired
19
+ def discard_expired
20
20
  logger.debug 'Removing expired images...'
21
21
  handle_iteration(image_handler.expired) { |item| image_handler.delete item }
22
22
  end
23
23
 
24
- def remove_templates(method, value)
24
+ def discard_templates(method, value)
25
25
  handle_iteration(template_handler.send(method, value)) { |item| template_handler.delete item }
26
26
  end
27
27
 
28
- def remove_images(method, value)
28
+ def discard_images(method, value)
29
29
  handle_iteration(image_handler.send(method, value)) do |item|
30
30
  image_handler.expire item
31
31
  image_handler.delete item
@@ -22,10 +22,13 @@ module Cloudkeeper
22
22
  templates = template_handler.find_by_image_list_id image_list_id
23
23
  templates.uniq! { |template| template["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::APPLIANCE_ID}"] }
24
24
 
25
- templates.map do |template|
25
+ appliances = templates.map do |template|
26
26
  image = find_image_for_template template
27
27
  populate_proto_appliance template, image
28
28
  end
29
+
30
+ logger.debug "Appliances: #{appliances.map(&:identifier).inspect}"
31
+ appliances
29
32
  end
30
33
 
31
34
  private
@@ -5,7 +5,7 @@ module Cloudkeeper
5
5
  include Utils::ImageDownload
6
6
  include Utils::TemplatePreparation
7
7
  include Cloudkeeper::One::ApplianceActions::Update
8
- include Cloudkeeper::One::ApplianceActions::Removal
8
+ include Cloudkeeper::One::ApplianceActions::Discard
9
9
 
10
10
  def register_or_update_appliance(proto_appliance)
11
11
  raise Cloudkeeper::One::Errors::ArgumentError, 'appliance cannot be nil' unless proto_appliance
@@ -13,7 +13,7 @@ module Cloudkeeper
13
13
  group = group_handler.find_by_name proto_appliance.vo
14
14
  raise Cloudkeeper::One::Errors::Actions::RegistrationError, "Missing group with name #{proto_appliance.vo}" unless group
15
15
 
16
- remove_images :find_by_appliance_id, proto_appliance.identifier
16
+ discard_images :find_by_appliance_id, proto_appliance.identifier
17
17
 
18
18
  datastores = datastore_handler.find_by_names Cloudkeeper::One::Settings[:'opennebula-datastores']
19
19
  datastores.each do |datastore|
@@ -2,7 +2,7 @@ module Cloudkeeper
2
2
  module One
3
3
  module ApplianceActions
4
4
  autoload :Registration, 'cloudkeeper/one/appliance_actions/registration'
5
- autoload :Removal, 'cloudkeeper/one/appliance_actions/removal'
5
+ autoload :Discard, 'cloudkeeper/one/appliance_actions/discard'
6
6
  autoload :Update, 'cloudkeeper/one/appliance_actions/update'
7
7
  autoload :List, 'cloudkeeper/one/appliance_actions/list'
8
8
  autoload :Utils, 'cloudkeeper/one/appliance_actions/utils'
@@ -4,7 +4,7 @@ module Cloudkeeper
4
4
  attr_reader :image_handler, :template_handler, :datastore_handler, :group_handler
5
5
 
6
6
  include Cloudkeeper::One::ApplianceActions::Registration
7
- include Cloudkeeper::One::ApplianceActions::Removal
7
+ include Cloudkeeper::One::ApplianceActions::Discard
8
8
  include Cloudkeeper::One::ApplianceActions::Update
9
9
  include Cloudkeeper::One::ApplianceActions::List
10
10
 
@@ -32,7 +32,7 @@ module Cloudkeeper
32
32
 
33
33
  def pre_action(_empty, call)
34
34
  logger.debug 'Running \'pre-action\'...'
35
- call_backend(call) { remove_expired }
35
+ call_backend(call) { discard_expired }
36
36
  end
37
37
 
38
38
  def post_action(_empty, call)
@@ -53,12 +53,12 @@ module Cloudkeeper
53
53
 
54
54
  def remove_appliance(appliance, call)
55
55
  logger.debug "Removing appliance #{appliance.identifier.inspect}"
56
- call_backend(call) { remove_appliance appliance }
56
+ call_backend(call) { discard_appliance appliance.identifier }
57
57
  end
58
58
 
59
59
  def remove_image_list(image_list_identifier, call)
60
60
  logger.debug "Removing appliances from image list #{image_list_identifier.image_list_identifier.inspect}"
61
- call_backend(call) { remove_image_list image_list_identifier.image_list_identifier }
61
+ call_backend(call) { discard_image_list image_list_identifier.image_list_identifier }
62
62
  end
63
63
 
64
64
  def image_lists(_empty, call)
@@ -1,5 +1,5 @@
1
1
  module Cloudkeeper
2
2
  module One
3
- VERSION = '1.2.2'.freeze
3
+ VERSION = '1.2.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudkeeper-one
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Kimle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-26 00:00:00.000000000 Z
11
+ date: 2017-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -168,16 +168,22 @@ dependencies:
168
168
  name: grpc-tools
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - "~>"
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '1.1'
174
+ - - "<="
172
175
  - !ruby/object:Gem::Version
173
- version: '1.0'
176
+ version: 1.2.5
174
177
  type: :development
175
178
  prerelease: false
176
179
  version_requirements: !ruby/object:Gem::Requirement
177
180
  requirements:
178
- - - "~>"
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '1.1'
184
+ - - "<="
179
185
  - !ruby/object:Gem::Version
180
- version: '1.0'
186
+ version: 1.2.5
181
187
  - !ruby/object:Gem::Dependency
182
188
  name: thor
183
189
  requirement: !ruby/object:Gem::Requirement
@@ -210,16 +216,22 @@ dependencies:
210
216
  name: grpc
211
217
  requirement: !ruby/object:Gem::Requirement
212
218
  requirements:
213
- - - "~>"
219
+ - - ">="
220
+ - !ruby/object:Gem::Version
221
+ version: '1.1'
222
+ - - "<="
214
223
  - !ruby/object:Gem::Version
215
- version: '1.0'
224
+ version: 1.2.5
216
225
  type: :runtime
217
226
  prerelease: false
218
227
  version_requirements: !ruby/object:Gem::Requirement
219
228
  requirements:
220
- - - "~>"
229
+ - - ">="
230
+ - !ruby/object:Gem::Version
231
+ version: '1.1'
232
+ - - "<="
221
233
  - !ruby/object:Gem::Version
222
- version: '1.0'
234
+ version: 1.2.5
223
235
  - !ruby/object:Gem::Dependency
224
236
  name: settingslogic
225
237
  requirement: !ruby/object:Gem::Requirement
@@ -324,9 +336,9 @@ files:
324
336
  - examples/etc/init.d/cloudkeeper-one
325
337
  - lib/cloudkeeper/one.rb
326
338
  - lib/cloudkeeper/one/appliance_actions.rb
339
+ - lib/cloudkeeper/one/appliance_actions/discard.rb
327
340
  - lib/cloudkeeper/one/appliance_actions/list.rb
328
341
  - lib/cloudkeeper/one/appliance_actions/registration.rb
329
- - lib/cloudkeeper/one/appliance_actions/removal.rb
330
342
  - lib/cloudkeeper/one/appliance_actions/update.rb
331
343
  - lib/cloudkeeper/one/appliance_actions/utils.rb
332
344
  - lib/cloudkeeper/one/appliance_actions/utils/image_download.rb