Skip to content

Commit

Permalink
Revert "Merge pull request #18443 from d-m-u/remove_lbs_from_retireme…
Browse files Browse the repository at this point in the history
…nt_check"

This reverts commit 2aa3228.
  • Loading branch information
simaishi committed Feb 19, 2019
1 parent a6ad2f3 commit 7a4a22b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/models/load_balancer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ 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
[OrchestrationStack, Vm, Service].flat_map do |i|
[LoadBalancer, OrchestrationStack, Vm, Service].flat_map do |i|
instances = not_retired_with_ems(i, ems_ids)
instances.each(&:retirement_check)
end
Expand Down
4 changes: 3 additions & 1 deletion spec/models/retirement_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
_, _, zone = EvmSpecHelper.local_guid_miq_server_zone
ems = FactoryGirl.create(:ems_network, :zone => zone)

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

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

0 comments on commit 7a4a22b

Please sign in to comment.