From 60173537665464db260fb93829eb8affced33535 Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Tue, 20 Sep 2016 19:11:01 +0300 Subject: [PATCH] Add 'Container' field for MD parser The logic of filtering of fake RAID MD heavily relies on the presence of of 'Container' field inside of parsed data. If this field is missing, it will never figure out the name of any fake RAID devices and its component. This patch adds this field to a parser. In addition to that, it also logs all found fake RAIDs and their components for the sake of easy debugging. Change-Id: I2066c5a0e995e542271cd308c9d83e2373787be4 Closes-Bug: #1617071 --- agent | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agent b/agent index fafd512..4e7acfe 100755 --- a/agent +++ b/agent @@ -913,7 +913,8 @@ class NodeAgent begin description, _, components = data.split(/Number\s+Major\s+Minor\s+RaidDevice\s+(State\s+)?/m) line_patterns = ['Version', 'Raid Level', 'Raid Devices', 'Active Devices', - 'Spare Devices', 'Failed Devices', 'State', 'UUID'] + 'Spare Devices', 'Failed Devices', 'State', 'UUID', + 'Container'] for line in (description.split("\n")[1..-1] rescue []) line.strip! next if line == "" @@ -961,6 +962,9 @@ class NodeAgent mds, devices = _find_fake_raid_mds() + @logger.debug("Found fake RAIDs: #{mds}") + @logger.debug("Found components of fake RAIDs: #{devices}") + Dir["/sys/block/*"].each do |block_device_dir| basename_dir = File.basename(block_device_dir) # Entries in /sys/block for cciss look like cciss!c0d1 while