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(