Stop enforcing obsolete limits on partition count. (#1460668)

This commit is contained in:
Vojtech Trefny 2017-06-30 08:52:56 +02:00
parent 2dc4db6f5c
commit e8cad136be
2 changed files with 53 additions and 1 deletions

View File

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

View File

@ -5,13 +5,14 @@ Version: 2.1.9
#%%global prerelease .b1
# prerelease, if defined, should be something like .a1, .b1, .b2.dev1, or .c2
Release: 1%{?prerelease}%{?dist}
Release: 2%{?prerelease}%{?dist}
Epoch: 1
License: LGPLv2+
Group: System Environment/Libraries
%global realname blivet
%global realversion %{version}%{?prerelease}
Source0: http://github.com/rhinstaller/blivet/archive/%{realname}-%{realversion}.tar.gz
Patch0: 0001-Stop-enforcing-obsolete-limits-on-partition-count.patch
# Versions of required components (done so we make sure the buildrequires
# match the requires versions of things).
@ -62,6 +63,7 @@ configuration.
%prep
%setup -q -n %{realname}-%{realversion}
%patch0 -p1
rm -rf %{py3dir}
cp -a . %{py3dir}
@ -81,6 +83,9 @@ make PYTHON=%{__python3} DESTDIR=%{buildroot} install
%{python3_sitelib}/*
%changelog
* Fri Jun 30 2017 Vojtech Trefny <vtrefny@redhat.com> - 2.1.9-2
- Stop enforcing obsolete limits on partition count (dlehman)
* Thu Jun 01 2017 Vojtech Trefny <vtrefny@redhat.com> - 2.1.9-1
- Adapt to logging module name change (mkolman)
- Updated calls to avoid log spamming (japokorn)