neil / rpms / python-blivet

Forked from rpms/python-blivet a year ago
Clone

Blame SOURCES/0020-Fix-reading-LV-attributes-in-LVMVolumeGroupDevice.patch

0b05ab
From 5097a0f3fba2960fc77cfd6ceb828287f60c930c Mon Sep 17 00:00:00 2001
0b05ab
From: Vojtech Trefny <vtrefny@redhat.com>
0b05ab
Date: Thu, 6 Dec 2018 10:32:58 +0100
0b05ab
Subject: [PATCH] Fix reading LV attributes in LVMVolumeGroupDevice.status
0b05ab
0b05ab
This was not adjusted to libblockdev API when cherry-picking fixes
0b05ab
from rhel7-branch in 3c8f8dbf78b0a093e120f69241b44a48ff07be30
0b05ab
---
0b05ab
 blivet/devices/lvm.py | 7 +++----
0b05ab
 1 file changed, 3 insertions(+), 4 deletions(-)
0b05ab
0b05ab
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
0b05ab
index 7835b7e8..8c4ee2ba 100644
0b05ab
--- a/blivet/devices/lvm.py
0b05ab
+++ b/blivet/devices/lvm.py
0b05ab
@@ -222,11 +222,10 @@ def status(self):
0b05ab
             try:
0b05ab
                 lvs_info = blockdev.lvm.lvs(vg_name=self.name)
0b05ab
             except blockdev.LVMError:
0b05ab
-                lvs_info = dict()
0b05ab
+                lvs_info = []
0b05ab
 
0b05ab
-            for lv_info in lvs_info.values():
0b05ab
-                lv_attr = udev.device_get_lv_attr(lv_info)
0b05ab
-                if lv_attr and lv_attr[4] == 'a':
0b05ab
+            for lv_info in lvs_info:
0b05ab
+                if lv_info.attr and lv_info.attr[4] == 'a':
0b05ab
                     return True
0b05ab
 
0b05ab
             return False