Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhysicalRack refresh action #17162

Merged
merged 1 commit into from
May 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions app/models/physical_rack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,23 @@ class PhysicalRack < ApplicationRecord

has_many :physical_chassis, :dependent => :nullify, :inverse_of => :physical_rack
has_many :physical_servers, :dependent => :nullify, :inverse_of => :physical_rack

def my_zone
ems = ext_management_system
ems ? ems.my_zone : MiqServer.my_zone
end

def refresh_ems
unless ext_management_system
raise _("No Provider defined")
end
unless ext_management_system.has_credentials?
raise _("No Provider credentials defined")
end
unless ext_management_system.authentication_status_ok?
raise _("Provider failed last authentication check")
end

EmsRefresh.queue_refresh(ext_management_system)
end
end
9 changes: 9 additions & 0 deletions db/fixtures/miq_product_features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5867,6 +5867,15 @@
:description: Display Individual Physical Rack
:feature_type: view
:identifier: physical_rack_show
- :name: Operate
:description: Perform Operations on Physical Racks
:feature_type: control
:identifier: physical_rack_control
:children:
- :name: Refresh
:description: Refresh relationships and power states for all items related to Physical Rack
:feature_type: control
:identifier: physical_rack_refresh

# Physical Chassis
- :name: Physical Chassis
Expand Down
1 change: 1 addition & 0 deletions db/fixtures/miq_user_roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@
- ems_physical_infra_refresh
- ems_physical_infra_tag
- ems_physical_infra_view
- physical_rack_control
- physical_rack_view
- physical_switch_view
- physical_server_view
Expand Down