Ticket #20: patch

File patch, 685 bytes (added by gandalf, 23 months ago)

3ware-status patch to fix issues with empty card ports

  • 3ware-status

    old new  
    3636    lines = [] 
    3737    for line in output: 
    3838        if re.match(r'^[p][0-9]+\s.*$',line.strip()): 
    39             lines.append(line.split()) 
     39            # Shoudl contain something like 'u0' 
     40            # '-' means the drive doesn't belong to any array 
     41            # If is NOT PRESENT too, it just means this is an empty port 
     42            if not line.split()[2].strip() == '-' and not line.split()[1].strip() == 'NOT-PRESENT': 
     43                lines.append(line.split()) 
    4044    if fake_failure: 
    4145        lines[0][1] = 'NOT PRESENT' 
    4246    return lines