From 0c3cb13730730da2edcc6567bec8256eee9b1770 Mon Sep 17 00:00:00 2001
From: Vendula Poncova <vponcova@redhat.com>
Date: Thu, 13 Aug 2020 12:39:40 +0200
Subject: [PATCH] Don't generate container data for non-container device types

If the current device type is not a container device type, don't generate
container data for the device factory request.
---
 pyanaconda/modules/storage/partitioning/interactive/utils.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pyanaconda/modules/storage/partitioning/interactive/utils.py b/pyanaconda/modules/storage/partitioning/interactive/utils.py
index 0057abd6e..04313eded 100644
--- a/pyanaconda/modules/storage/partitioning/interactive/utils.py
+++ b/pyanaconda/modules/storage/partitioning/interactive/utils.py
@@ -808,6 +808,7 @@ def generate_device_factory_request(storage, device) -> DeviceFactoryRequest:
     if device_type is None:
         raise UnsupportedDeviceError("Unsupported type of {}.".format(device.name))
 
+    # Generate the device data.
     request = DeviceFactoryRequest()
     request.device_spec = device.name
     request.device_name = getattr(device.raw_device, "lvname", device.raw_device.name)
@@ -828,6 +829,10 @@ def generate_device_factory_request(storage, device) -> DeviceFactoryRequest:
 
     request.disks = [d.name for d in disks]
 
+    if request.device_type not in CONTAINER_DEVICE_TYPES:
+        return request
+
+    # Generate the container data.
     factory = devicefactory.get_device_factory(
         storage,
         device_type=device_type,
-- 
2.23.0

