berta 1.2.0 → 1.3.0

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: 90a76ac6f1f4e8ca79a9f1055d048e1388454f93
4
- data.tar.gz: 23521719c626908ab390da7bc21220ad4080f930
3
+ metadata.gz: ddb138a3a440ced8f3cac19a172dc852553bf6d7
4
+ data.tar.gz: d03578fdc338e243fa153094632a10e08f4e6925
5
5
  SHA512:
6
- metadata.gz: a0edddd944f03fe24b447ad0ebcee686546080c128492b9e89ec653dda484aae9dc88846eb1bac28c4454e9e2422c161e7e5a16557aaf1e1aa0fc85ea02f56b8
7
- data.tar.gz: 9c065dbd4e3336658349e7c1f41d9e7e32d4f7cc3608c465ad8cdc304d1d36c84ef3b43101625d9a3f8195e2770a8c9638c2aeb31418ae08807b5f35f9c45c13
6
+ metadata.gz: 5d39ec846445b8e28c9431aded6a925de3ecc61fb520e1f959964ee8ad917856761f7186573def0e85b9587d6785f860c7fbd944f2e5e617695965c23e2a627b
7
+ data.tar.gz: 12b40d29cb3e5549fa9ad8299af378d5b9a9f8b05d4a8eb434b3f76e501237eff5a236c73cdef1588b189ad2478aeda1cb184305981eb9c8e31566540770c859
@@ -34,7 +34,7 @@ module Berta
34
34
  # @param exps [Array<Berta::Entities::Expiration>] VMs expirations to modify
35
35
  # @return Expirations with default expiration
36
36
  def add_default_expiration(vm, exps)
37
- return exps if vm.default_expiration
37
+ return [] if vm.default_expiration
38
38
  exps << Berta::Entities::Expiration.new(vm.next_expiration_id,
39
39
  Time.now.to_i + Berta::Settings.expiration_offset,
40
40
  Berta::Settings.expiration.action)
data/lib/berta/service.rb CHANGED
@@ -66,9 +66,11 @@ module Berta
66
66
  # @raise [Berta::Errors::OpenNebula::ResourceStateError]
67
67
  # @raise [Berta::Errors::OpenNebula::ResourceRetrievalError]
68
68
  def clusters
69
+ return @cached_clusters if @cached_clusters
69
70
  logger.debug 'Fetching clusters'
70
71
  cluster_pool = OpenNebula::ClusterPool.new(client)
71
72
  Berta::Utils::OpenNebula::Helper.handle_error { cluster_pool.info }
73
+ @cached_clusters = cluster_pool
72
74
  cluster_pool
73
75
  end
74
76
 
data/lib/berta/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Berta
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
@@ -66,7 +66,7 @@ module Berta
66
66
  template = ''
67
67
  exps.each { |exp| template += exp.template }
68
68
  return if template == ''
69
- logger.debug "Setting multiple expirations:\n#{template}"
69
+ logger.debug "Setting multiple expirations on vm with id=#{handle['ID']} :\n#{template}"
70
70
  return if Berta::Settings['dry-run']
71
71
  Berta::Utils::OpenNebula::Helper.handle_error do
72
72
  handle.update(template, true)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berta
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dusan Baran
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-10 00:00:00.000000000 Z
11
+ date: 2017-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -300,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
300
300
  version: '0'
301
301
  requirements: []
302
302
  rubyforge_project:
303
- rubygems_version: 2.4.8
303
+ rubygems_version: 2.6.8
304
304
  signing_key:
305
305
  specification_version: 4
306
306
  summary: Berta VM expiration tool