Class: Berta::Exclusions
- Inherits:
-
Object
- Object
- Berta::Exclusions
- Defined in:
- lib/berta/exclusions.rb
Overview
Class for Handeling berta exclusions
Constant Summary collapse
- RESOURCE_STATES =
VM states that take resources
%w[SUSPENDED POWEROFF CLONING].freeze
- ACTIVE_STATE =
Active state has some lcm states that should not expire
'ACTIVE'.freeze
- NON_RESOURCE_ACTIVE_LCM_STATES =
LCM states in which active state shouldn’t expire
%w[EPILOG SHUTDOWN STOP UNDEPLOY FAILURE].freeze
Instance Method Summary collapse
-
#filter!(vmhs) ⇒ Object
Filters out excluded vms, and vms that doesn’t take resources.
-
#initialize(ids, users, groups, clusters) ⇒ Exclusions
constructor
Constructs Exclusions object.
Constructor Details
#initialize(ids, users, groups, clusters) ⇒ Exclusions
Constructs Exclusions object.
17 18 19 20 21 22 23 |
# File 'lib/berta/exclusions.rb', line 17 def initialize(ids, users, groups, clusters) @ids = ids @users = users @groups = groups @clusters = clusters log_exclusions end |
Instance Method Details
#filter!(vmhs) ⇒ Object
Filters out excluded vms, and vms that doesn’t take resources
28 29 30 31 32 33 34 35 36 |
# File 'lib/berta/exclusions.rb', line 28 def filter!(vmhs) filter_resources!(vmhs) filter_ids!(vmhs) filter_users!(vmhs) filter_groups!(vmhs) filter_clusters!(vmhs) logger.debug "After excluding: #{vmhs.map { |vmh| vmh.handle.id }}" vmhs end |