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