Blame 0001-Stop-enforcing-obsolete-limits-on-partition-count.patch

e8cad13
From 4b8bcadc43ed78a0eedb8e330684c626ef8b9d89 Mon Sep 17 00:00:00 2001
e8cad13
From: David Lehman <dlehman@redhat.com>
e8cad13
Date: Wed, 21 Jun 2017 15:36:42 -0400
e8cad13
Subject: [PATCH] Stop enforcing obsolete limits on partition count. (#1460668)
e8cad13
e8cad13
---
e8cad13
 blivet/partitioning.py     | 10 ++++------
e8cad13
 tests/partitioning_test.py | 20 +++++++++-----------
e8cad13
 2 files changed, 13 insertions(+), 17 deletions(-)
e8cad13
e8cad13
diff --git a/blivet/partitioning.py b/blivet/partitioning.py
e8cad13
index 05cb4c6..0a973e9 100644
e8cad13
--- a/blivet/partitioning.py
e8cad13
+++ b/blivet/partitioning.py
e8cad13
@@ -136,8 +136,6 @@ def get_next_partition_type(disk, no_primary=None):
e8cad13
     part_type = None
e8cad13
     extended = disk.getExtendedPartition()
e8cad13
     supports_extended = disk.supportsFeature(parted.DISK_TYPE_EXTENDED)
e8cad13
-    logical_count = len(disk.getLogicalPartitions())
e8cad13
-    max_logicals = disk.getMaxLogicalPartitions()
e8cad13
     primary_count = disk.primaryPartitionCount
e8cad13
e8cad13
     if primary_count < disk.maxPrimaryPartitionCount:
e8cad13
@@ -153,17 +151,17 @@ def get_next_partition_type(disk, no_primary=None):
e8cad13
                 # there is an extended and a free primary
e8cad13
                 if not no_primary:
e8cad13
                     part_type = parted.PARTITION_NORMAL
e8cad13
-                elif logical_count < max_logicals:
e8cad13
-                    # we have an extended with logical slots, so use one.
e8cad13
+                else:
e8cad13
+                    # we have an extended, so use it.
e8cad13
                     part_type = parted.PARTITION_LOGICAL
e8cad13
         else:
e8cad13
             # there are two or more primary slots left. use one unless we're
e8cad13
             # not supposed to make primaries.
e8cad13
             if not no_primary:
e8cad13
                 part_type = parted.PARTITION_NORMAL
e8cad13
-            elif extended and logical_count < max_logicals:
e8cad13
+            elif extended:
e8cad13
                 part_type = parted.PARTITION_LOGICAL
e8cad13
-    elif extended and logical_count < max_logicals:
e8cad13
+    elif extended:
e8cad13
         part_type = parted.PARTITION_LOGICAL
e8cad13
e8cad13
     return part_type
e8cad13
--
e8cad13
1.8.3.1