From fa669b4d02a4b334cded5644592d88cfa7feab2b Mon Sep 17 00:00:00 2001 From: Greg McCullough Date: Thu, 8 Jun 2017 10:43:30 -0400 Subject: [PATCH] Merge pull request #15334 from tinaafitz/orchestration_stack_add_zone Add orchestration stack my_zone. (cherry picked from commit 8e6d2fb05a36be637183b083efafbe7904f58e8d) https://bugzilla.redhat.com/show_bug.cgi?id=1465415 --- app/models/orchestration_stack.rb | 4 ++++ spec/models/service_orchestration_spec.rb | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/app/models/orchestration_stack.rb b/app/models/orchestration_stack.rb index 37179b15b3d..0d130fa6527 100644 --- a/app/models/orchestration_stack.rb +++ b/app/models/orchestration_stack.rb @@ -86,6 +86,10 @@ def raw_update_stack(_template, _options = {}) raise NotImplementedError, _("raw_update_stack must be implemented in a subclass") end + def my_zone + ext_management_system.try(:my_zone) + end + def update_stack(template, options = {}) raw_update_stack(template, options) end diff --git a/spec/models/service_orchestration_spec.rb b/spec/models/service_orchestration_spec.rb index bd267c42fe3..8433bc61b95 100644 --- a/spec/models/service_orchestration_spec.rb +++ b/spec/models/service_orchestration_spec.rb @@ -55,6 +55,17 @@ end end + describe "#my_zone" do + it "takes the zone from ext_management_system" do + deployed_stack.ext_management_system = manager_by_setter + expect(deployed_stack.my_zone).to eq(manager_by_setter.my_zone) + end + + it "returns nil if ext_management_system is not valid" do + expect(deployed_stack.my_zone).to eq(nil) + end + end + describe "#stack_options" do before do allow_any_instance_of(ManageIQ::Providers::Amazon::CloudManager::OrchestrationServiceOptionConverter).to(