On Mon, Oct 15, 2012 at 02:46:56PM -0400, Will Woods wrote:
parseMultipathOutput was assuming that each new mpath block would
start
with 'create: ' or 'mpath'. But sometimes we can get input like this:
create: mpatha [...]
`- 2:3:0:0 sda 8:0 undef ready running
reject: mpathb [...]
`- 2:255:1:0 sdb 8:16 undef ready running
Since the regex only matched 'create: ', it missed the start of the new
block and incorrectly puts 'sdb' into 'mpatha' with 'sda'.
Instead, match any string of lowercase letters and save that as the
'action'. When we hit the end of the block, if the action is 'create' or
None (i.e. the plain 'mpath' case) it's saved, otherwise it's ignored.
(We should only ever see 'reject' and 'create' as far as I can tell, but
better safe than sorry.)
---
storage/devicelibs/mpath.py | 11 ++++++-----
tests/storage/devicelibs/mpath.py | 17 +++++++++++++++++
2 files changed, 23 insertions(+), 5 deletions(-)
ACK
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)