Skip to content

Commit

Permalink
We shouldn't retire load balancers
Browse files Browse the repository at this point in the history
  • Loading branch information
d-m-u committed Feb 11, 2019
1 parent 6f5a1b0 commit 4940668
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/models/load_balancer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ class LoadBalancer < ApplicationRecord
include NewWithTypeStiMixin
include AsyncDeleteMixin
include ProcessTasksMixin
include RetirementMixin
include TenantIdentityMixin
include CloudTenancyMixin
include CustomActionsMixin
Expand Down
2 changes: 1 addition & 1 deletion app/models/retirement_manager.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class RetirementManager
def self.check
ems_ids = MiqServer.my_server.zone.ext_management_system_ids
[LoadBalancer, OrchestrationStack, Vm, Service].flat_map do |i|
[OrchestrationStack, Vm, Service].flat_map do |i|
instances = not_retired_with_ems(i, ems_ids)
instances.each(&:retirement_check)
end
Expand Down
4 changes: 1 addition & 3 deletions spec/models/retirement_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
_, _, zone = EvmSpecHelper.local_guid_miq_server_zone
ems = FactoryBot.create(:ems_network, :zone => zone)

load_balancer = FactoryBot.create(:load_balancer, :retires_on => Time.zone.today + 1.day, :ext_management_system => ems)
FactoryBot.create(:load_balancer, :retired => true)
orchestration_stack = FactoryBot.create(:orchestration_stack, :retires_on => Time.zone.today + 1.day, :ext_management_system => ems)
FactoryBot.create(:orchestration_stack, :retired => true)
vm = FactoryBot.create(:vm, :retires_on => Time.zone.today + 1.day, :ems_id => ems.id)
FactoryBot.create(:vm, :retired => true)
service = FactoryBot.create(:service, :retires_on => Time.zone.today + 1.day)
FactoryBot.create(:service, :retired => true)

expect(RetirementManager.check).to match_array([load_balancer, orchestration_stack, vm, service])
expect(RetirementManager.check).to match_array([orchestration_stack, vm, service])
end
end
end

0 comments on commit 4940668

Please sign in to comment.