From 036d06553a27c14e7525f8fb57096c9e980d3ad9 Mon Sep 17 00:00:00 2001 From: Gerhard Gonter <ggonter@gmail.com> Date: Mon, 9 Mar 2020 16:14:07 +0100 Subject: [PATCH] parse multiple physical devices (see [1]) and parse attributes of physical devices with punctuation characters in their names, e.g.: ``` Reported Channel,Device(T:L) : 0,0(0:0) S.M.A.R.T. : No S.M.A.R.T. warnings : 0 ``` * [1] https://github.com/kumy/Parse-Arcconf/issues/2 --- lib/Parse/Arcconf.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Parse/Arcconf.pm b/lib/Parse/Arcconf.pm index 1a5d99c..32c6047 100644 --- a/lib/Parse/Arcconf.pm +++ b/lib/Parse/Arcconf.pm @@ -238,12 +238,12 @@ sub parse_config_fh $current_physical_drive = $1; } elsif ($line =~ /^\s+Device is (.*\w)/) { $ctrl->{'physical drive'}{$current_physical_drive}{'Device is'} = $1; - } elsif ($line =~ /^\s+(.*\w)\s+:\s+(.*)$/) { + } elsif ($line =~ /^\s+(.*[\w\)\.]+)\s+:\s+(.*)$/) { $ctrl->{'physical drive'}{$current_physical_drive}{$1} = $2; } elsif ($line =~ /^\s+-+$/) { last LEVEL3; } elsif ($line =~ /^$/) { - last LEVEL2; + # last LEVEL2; } } } -- GitLab