neil / rpms / python-blivet

Forked from rpms/python-blivet a year ago
Clone
Blob Blame History Raw
From 5097a0f3fba2960fc77cfd6ceb828287f60c930c Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Thu, 6 Dec 2018 10:32:58 +0100
Subject: [PATCH] Fix reading LV attributes in LVMVolumeGroupDevice.status

This was not adjusted to libblockdev API when cherry-picking fixes
from rhel7-branch in 3c8f8dbf78b0a093e120f69241b44a48ff07be30
---
 blivet/devices/lvm.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
index 7835b7e8..8c4ee2ba 100644
--- a/blivet/devices/lvm.py
+++ b/blivet/devices/lvm.py
@@ -222,11 +222,10 @@ def status(self):
             try:
                 lvs_info = blockdev.lvm.lvs(vg_name=self.name)
             except blockdev.LVMError:
-                lvs_info = dict()
+                lvs_info = []
 
-            for lv_info in lvs_info.values():
-                lv_attr = udev.device_get_lv_attr(lv_info)
-                if lv_attr and lv_attr[4] == 'a':
+            for lv_info in lvs_info:
+                if lv_info.attr and lv_info.attr[4] == 'a':
                     return True
 
             return False