From 7186aa682a38b2f47abb4f15f8ae95a2d5e74d47 Mon Sep 17 00:00:00 2001 From: Julian Cheal Date: Wed, 15 Mar 2017 20:35:53 +0000 Subject: [PATCH] Fixed refresh & save for Physical Infra. Added Physical Infra to the required classes to be included in save inventory. Remove `enabled` from PhysicalServers as the field is not in the model, so was causing an issue trying to save a value that wasn't there. --- app/models/ems_refresh.rb | 1 + app/models/ems_refresh/save_inventory.rb | 1 + app/models/physical_server.rb | 2 -- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/ems_refresh.rb b/app/models/ems_refresh.rb index 3045a229ccd..852a52ec7a6 100644 --- a/app/models/ems_refresh.rb +++ b/app/models/ems_refresh.rb @@ -3,6 +3,7 @@ module EmsRefresh extend EmsRefresh::SaveInventoryBlockStorage extend EmsRefresh::SaveInventoryCloud extend EmsRefresh::SaveInventoryInfra + extend EmsRefresh::SaveInventoryPhysicalInfra extend EmsRefresh::SaveInventoryContainer extend EmsRefresh::SaveInventoryMiddleware extend EmsRefresh::SaveInventoryDatawarehouse diff --git a/app/models/ems_refresh/save_inventory.rb b/app/models/ems_refresh/save_inventory.rb index 6c6d7082ee3..d0c7655a31b 100644 --- a/app/models/ems_refresh/save_inventory.rb +++ b/app/models/ems_refresh/save_inventory.rb @@ -12,6 +12,7 @@ def save_ems_inventory(ems, hashes, target = nil) case ems when EmsCloud then save_ems_cloud_inventory(ems, hashes, target) when EmsInfra then save_ems_infra_inventory(ems, hashes, target) + when EmsPhysicalInfra then save_ems_physical_infra_inventory(ems, hashes, target) when ManageIQ::Providers::AutomationManager then save_automation_manager_inventory(ems, hashes, target) when ManageIQ::Providers::ConfigurationManager then save_configuration_manager_inventory(ems, hashes, target) when ManageIQ::Providers::ContainerManager then save_ems_container_inventory(ems, hashes, target) diff --git a/app/models/physical_server.rb b/app/models/physical_server.rb index 375bbf20f4c..8fda121f54a 100644 --- a/app/models/physical_server.rb +++ b/app/models/physical_server.rb @@ -5,8 +5,6 @@ class PhysicalServer < ApplicationRecord belongs_to :ext_management_system, :foreign_key => :ems_id, :class_name => "ManageIQ::Providers::PhysicalInfraManager" - default_value_for :enabled, true - def name_with_details details % { :name => name,