Skip to content

Commit

Permalink
Simplify configured_systems queue_name_for_ems_ops
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Jan 27, 2020
1 parent b379569 commit 6bc4102
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/configured_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ConfiguredSystem < ApplicationRecord
delegate :name, :to => :customization_script_ptable, :prefix => true, :allow_nil => true
delegate :name, :to => :operating_system_flavor, :prefix => true, :allow_nil => true
delegate :name, :to => :provider, :prefix => true, :allow_nil => true
delegate :my_zone, :provider, :zone, :to => :manager
delegate :my_zone, :provider, :queue_name_for_ems_operations, :zone, :to => :manager

virtual_column :my_zone, :type => :string
virtual_column :configuration_architecture_name, :type => :string
Expand Down
2 changes: 1 addition & 1 deletion app/models/miq_provision_configured_system_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def my_role(_action = nil)
end

def my_queue_name
src_configured_systems.first&.manager&.queue_name_for_ems_operations
src_configured_systems.first.nil? ? super : src_configured_systems.first&.queue_name_for_ems_operations
end

def self.request_task_class_from(_attribs)
Expand Down
4 changes: 4 additions & 0 deletions spec/models/physical_server_firmware_update_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
expect(subject.my_role).to eq('ems_operations')
end

it '#my_queue_name' do
expect(subject.my_queue_name).to be_nil
end

it '#requested_task_idx' do
expect(subject.requested_task_idx).to eq([-1])
end
Expand Down

0 comments on commit 6bc4102

Please sign in to comment.