neil / rpms / python-blivet

Forked from rpms/python-blivet a year ago
Clone
0b05ab
From cd85b0a41f16c571675f04c58ec4c1a428a88a61 Mon Sep 17 00:00:00 2001
0b05ab
From: Vojtech Trefny <vtrefny@redhat.com>
0b05ab
Date: Thu, 16 Aug 2018 13:00:35 +0200
0b05ab
Subject: [PATCH] Create a separate availability check for dmraid support
0b05ab
0b05ab
Resolves: rhbz#1617958
0b05ab
---
0b05ab
 blivet/devices/disk.py       | 2 +-
0b05ab
 blivet/tasks/availability.py | 9 +++++++--
0b05ab
 2 files changed, 8 insertions(+), 3 deletions(-)
0b05ab
0b05ab
diff --git a/blivet/devices/disk.py b/blivet/devices/disk.py
0b05ab
index 5b52330..012413c 100644
0b05ab
--- a/blivet/devices/disk.py
0b05ab
+++ b/blivet/devices/disk.py
0b05ab
@@ -225,7 +225,7 @@ class DMRaidArrayDevice(DMDevice, ContainerDevice):
0b05ab
     _is_disk = True
0b05ab
     _format_class_name = property(lambda s: "dmraidmember")
0b05ab
     _format_uuid_attr = property(lambda s: None)
0b05ab
-    _external_dependencies = [availability.BLOCKDEV_DM_PLUGIN]
0b05ab
+    _external_dependencies = [availability.BLOCKDEV_DM_PLUGIN_RAID]
0b05ab
 
0b05ab
     def __init__(self, name, fmt=None,
0b05ab
                  size=None, parents=None, sysfs_path='', wwn=None):
0b05ab
diff --git a/blivet/tasks/availability.py b/blivet/tasks/availability.py
0b05ab
index 24909a2..7f64c10 100644
0b05ab
--- a/blivet/tasks/availability.py
0b05ab
+++ b/blivet/tasks/availability.py
0b05ab
@@ -331,10 +331,14 @@ BLOCKDEV_DM_ALL_MODES = (blockdev.DMTechMode.CREATE_ACTIVATE |
0b05ab
                          blockdev.DMTechMode.QUERY)
0b05ab
 BLOCKDEV_DM = BlockDevTechInfo(plugin_name="dm",
0b05ab
                                check_fn=blockdev.dm_is_tech_avail,
0b05ab
-                               technologies={blockdev.DMTech.MAP: BLOCKDEV_DM_ALL_MODES,
0b05ab
-                                             blockdev.DMTech.RAID: BLOCKDEV_DM_ALL_MODES})
0b05ab
+                               technologies={blockdev.DMTech.MAP: BLOCKDEV_DM_ALL_MODES})
0b05ab
 BLOCKDEV_DM_TECH = BlockDevMethod(BLOCKDEV_DM)
0b05ab
 
0b05ab
+BLOCKDEV_DM_RAID = BlockDevTechInfo(plugin_name="dm",
0b05ab
+                               check_fn=blockdev.dm_is_tech_avail,
0b05ab
+                               technologies={blockdev.DMTech.RAID: BLOCKDEV_DM_ALL_MODES})
0b05ab
+BLOCKDEV_DM_TECH_RAID = BlockDevMethod(BLOCKDEV_DM_RAID)
0b05ab
+
0b05ab
 # libblockdev loop plugin required technologies and modes
0b05ab
 BLOCKDEV_LOOP_ALL_MODES = (blockdev.LoopTechMode.CREATE |
0b05ab
                            blockdev.LoopTechMode.CREATE |
0b05ab
@@ -399,6 +403,7 @@ BLOCKDEV_SWAP_TECH = BlockDevMethod(BLOCKDEV_SWAP)
0b05ab
 BLOCKDEV_BTRFS_PLUGIN = blockdev_plugin("btrfs", BLOCKDEV_BTRFS_TECH)
0b05ab
 BLOCKDEV_CRYPTO_PLUGIN = blockdev_plugin("crypto", BLOCKDEV_CRYPTO_TECH)
0b05ab
 BLOCKDEV_DM_PLUGIN = blockdev_plugin("dm", BLOCKDEV_DM_TECH)
0b05ab
+BLOCKDEV_DM_PLUGIN_RAID = blockdev_plugin("dm", BLOCKDEV_DM_TECH_RAID)
0b05ab
 BLOCKDEV_LOOP_PLUGIN = blockdev_plugin("loop", BLOCKDEV_LOOP_TECH)
0b05ab
 BLOCKDEV_LVM_PLUGIN = blockdev_plugin("lvm", BLOCKDEV_LVM_TECH)
0b05ab
 BLOCKDEV_MDRAID_PLUGIN = blockdev_plugin("mdraid", BLOCKDEV_MD_TECH)
0b05ab
-- 
0b05ab
1.8.3.1
0b05ab