app/models/manageiq/providers/lenovo/physical_infra_manager/parser/physical_storage_parser.rb
#
# Parse a storage into a hash
#
# @param [Hash] storage_hash - hash containing physical storage raw data
# @param [Hash] rack - parsed physical rack data
# @param [Hash] chassis - parsed physical chassis data
#
# @return [Hash] containing the physical storage information
#
Parse a storage into a hash
Parse a storage into a hash
def parse_physical_storage(storage_hash, rack, chassis)
        storage = XClarityClient::Storage.new(storage_hash)
        result = parse(storage, parent::ParserDictionaryConstants::PHYSICAL_STORAGE)
        result[:physical_rack]              = rack if rack
        result[:physical_chassis]           = chassis if chassis
        result[:type]                       = parent::ParserDictionaryConstants::MIQ_TYPES["physical_storage"]
        result[:health_state]               = parent::ParserDictionaryConstants::HEALTH_STATE_MAP[storage.cmmHealthState.nil? ? storage.cmmHealthState : storage.cmmHealthState.downcase]
        result[:computer_system][:hardware] = get_hardwares(storage)
        result
      end
def parse_physical_storage ( storage_hash , rack , chassis ) storage = XClarityClient :: Storage . new ( storage_hash ) result = parse ( storage , parent :: ParserDictionaryConstants :: PHYSICAL_STORAGE ) result [ :physical_rack ] = rack if rack result [ :physical_chassis ] = chassis if chassis result [ :type ] = parent :: ParserDictionaryConstants :: MIQ_TYPES [ "physical_storage" ] result [ :health_state ] = parent :: ParserDictionaryConstants :: HEALTH_STATE_MAP [ storage . cmmHealthState . nil? ? storage . cmmHealthState : storage . cmmHealthState . downcase ] result [ :computer_system ] [ :hardware ] = get_hardwares ( storage ) result end
Parse a storage into a hash
Parse a storage into a hash
containing the physical storage information
containing the physical storage information
Hash
storage_hash
rack
chassis
parsed physical chassis data
parsed physical chassis data