[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH rhel 5.4] Do not include removed physical volumes in pvlist (#502438).



Port of patch 75686e14147a0f37700eade5f9441c75796d916a from rhel 4.9.
---
 lvm.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lvm.py b/lvm.py
index 83e19b4..c0608ee 100644
--- a/lvm.py
+++ b/lvm.py
@@ -263,6 +263,9 @@ def pvlist():
         except:
             continue
         log.info("pv is %s in vg %s, size is %s" %(dev, vg, size))
+        # We only append if the device is valid
+        if dev.strip().lower() == "unknown device":
+            continue
         pvs.append( (dev, vg, size) )
 
     return pvs
-- 
1.5.4.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]