summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@mirantis.com>2016-09-20 19:11:01 +0300
committerAlexander Gordeev <agordeev@mirantis.com>2016-09-20 19:16:04 +0300
commit60173537665464db260fb93829eb8affced33535 (patch)
tree1a19b88d5a3db8ed657a5a18245cfb5900cb067c
parent79ca6e27f7a4e75519895202f9e1e9cabb8aca7a (diff)
Add 'Container' field for MD parser10.0.0rc110.0.0
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
Notes
Notes (review): Verified+1: Fuel CI <fuel-ci-bot@mirantis.com> Code-Review+1: Maksim Malchuk <mmalchuk@mirantis.com> Code-Review+2: Vladimir Kozhukalov <vkozhukalov@mirantis.com> Workflow+1: Vladimir Sharshov <vsharshov@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 21 Sep 2016 13:37:24 +0000 Reviewed-on: https://review.openstack.org/373448 Project: openstack/fuel-nailgun-agent Branch: refs/heads/master
-rwxr-xr-xagent6
1 files changed, 5 insertions, 1 deletions
diff --git a/agent b/agent
index fafd512..4e7acfe 100755
--- a/agent
+++ b/agent
@@ -913,7 +913,8 @@ class NodeAgent
913 begin 913 begin
914 description, _, components = data.split(/Number\s+Major\s+Minor\s+RaidDevice\s+(State\s+)?/m) 914 description, _, components = data.split(/Number\s+Major\s+Minor\s+RaidDevice\s+(State\s+)?/m)
915 line_patterns = ['Version', 'Raid Level', 'Raid Devices', 'Active Devices', 915 line_patterns = ['Version', 'Raid Level', 'Raid Devices', 'Active Devices',
916 'Spare Devices', 'Failed Devices', 'State', 'UUID'] 916 'Spare Devices', 'Failed Devices', 'State', 'UUID',
917 'Container']
917 for line in (description.split("\n")[1..-1] rescue []) 918 for line in (description.split("\n")[1..-1] rescue [])
918 line.strip! 919 line.strip!
919 next if line == "" 920 next if line == ""
@@ -961,6 +962,9 @@ class NodeAgent
961 962
962 mds, devices = _find_fake_raid_mds() 963 mds, devices = _find_fake_raid_mds()
963 964
965 @logger.debug("Found fake RAIDs: #{mds}")
966 @logger.debug("Found components of fake RAIDs: #{devices}")
967
964 Dir["/sys/block/*"].each do |block_device_dir| 968 Dir["/sys/block/*"].each do |block_device_dir|
965 basename_dir = File.basename(block_device_dir) 969 basename_dir = File.basename(block_device_dir)
966 # Entries in /sys/block for cciss look like cciss!c0d1 while 970 # Entries in /sys/block for cciss look like cciss!c0d1 while