berta 1.5.2 → 1.6.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: 38b7c4c208604f8f2f38e396c03dd8d0950626a9
4
- data.tar.gz: 844a95982da959c7be4ba173095a7910c96e21cf
3
+ metadata.gz: a8df6d853b8b26247ece5370a887b57f983f8680
4
+ data.tar.gz: 6c643a92a154fd50bbee3e2fd306db34273d89f3
5
5
  SHA512:
6
- metadata.gz: 7fca088e770e144d0ad3027a54a36f4bf7b9e04a80aecc2533a7244a84ae03b88a4cfadc86fb635793a4463b5b5ef3437d6c6dee1b1d0fe53ea3b8a674a928fc
7
- data.tar.gz: 63ea0386912c8a2ee7a6ba3d9d4fa5ea60521510f1614ab03a671c53547145f2bbb9d07f5b9c5268aea3e4a7e8f8a29f91474771df699205de53570f88ecc6de
6
+ metadata.gz: 5e09339128c099ccbbf4ea5145e9c5f9a870a02a41912f0088a5d3b27f6f4f8df3b4a27a7b3ec0b1d72c9124add90de81f28d5e8c8ee222876d27e8660636860
7
+ data.tar.gz: fb69818b1b5e4781d8c28bd3fc441e5f5853252a77fc991e36ceb7180d0ab23056eb183cffdddc697518c348b6c859508f38dac4d9d0a53bc50225b6f15251c7
@@ -2,12 +2,8 @@ module Berta
2
2
  module Utils
3
3
  # Base Filter class, filters out invalid states
4
4
  class Filter
5
- # VM states that take resources
6
- RESOURCE_STATES = %w[SUSPENDED POWEROFF CLONING].freeze
7
- # Active state has some lcm states that should not expire
8
- ACTIVE_STATE = 'ACTIVE'.freeze
9
- # LCM states in which active state shouldn't expire
10
- NON_RESOURCE_ACTIVE_LCM_STATES = %w[EPILOG SHUTDOWN STOP UNDEPLOY FAILURE].freeze
5
+ # VM states to ignore
6
+ IGNORED_STATES = %w[PENDING HOLD].freeze
11
7
 
12
8
  # Constructs Filter object.
13
9
  #
@@ -83,9 +79,7 @@ module Berta
83
79
  private
84
80
 
85
81
  def takes_resources?(vmh)
86
- return true if RESOURCE_STATES.any? { |state| vmh.handle.state_str == state }
87
- true if vmh.handle.state_str == ACTIVE_STATE &&
88
- NON_RESOURCE_ACTIVE_LCM_STATES.none? { |state| vmh.handle.lcm_state_str.include? state }
82
+ !IGNORED_STATES.include?(vmh.handle.state_str)
89
83
  end
90
84
 
91
85
  def log_filter
data/lib/berta/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Berta
2
- VERSION = '1.5.2'.freeze
2
+ VERSION = '1.6.0'.freeze
3
3
  end
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.5.2
4
+ version: 1.6.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-06-01 00:00:00.000000000 Z
11
+ date: 2017-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler