Looks like the code that was added to check for partition slots running out was expecting at least one local disk being present. With no local disk - such as during multipath install - this caused a traceback as the disklabel variable used for checking partition slots was not set. I've modified the check to only run if the disklabel variable is set, which should fix the issue for multipath and still work fine for local install.
Martin Kolman (1): Check if disklabel is set (#1007683)
storage/partitioning.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
The disklabel variable, needed by the partition slot check might not be set if multipath & custom partitioning is used. Therefore make sure the partition slot check is done only if disklabel is set.
Signed-off-by: Martin Kolman mkolman@redhat.com --- storage/partitioning.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/storage/partitioning.py b/storage/partitioning.py index 1e7f583..79d2cc0 100644 --- a/storage/partitioning.py +++ b/storage/partitioning.py @@ -1061,6 +1061,13 @@ def allocatePartitions(storage, disks, partitions, freespace): use_disk = None part_type = None growth = 0 + # initialize the disklabel variable to None, + # so we can safely check if the variable was set or not + # (req_disks can be empty if using multipath with custom + # partitioning, in this case disklabel will not be set by the + # for loop and we need to check for that, as there are + # some check working with disklabel after the loop) + disklabel = None # loop through disks for _disk in req_disks: disklabel = disklabels[_disk.path] @@ -1213,7 +1220,9 @@ def allocatePartitions(storage, disks, partitions, freespace): log.debug("found free space for bootable request") break
- if getNextPartitionType(disklabel.partedDisk) is None: + # check if disklabel is set and if it is, check if the disk is + # out of partition slots (None = out of partition slots) + if disklabel is not None and getNextPartitionType(disklabel.partedDisk) is None: raise PartitioningError("no free partition slots on %s" % _disk.name)
I think this is ok.
On Mon, Oct 14, 2013 at 04:32:36PM +0200, Martin Kolman wrote:
The disklabel variable, needed by the partition slot check might not be set if multipath & custom partitioning is used. Therefore make sure the partition slot check is done only if disklabel is set.
Signed-off-by: Martin Kolman mkolman@redhat.com
storage/partitioning.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/storage/partitioning.py b/storage/partitioning.py index 1e7f583..79d2cc0 100644 --- a/storage/partitioning.py +++ b/storage/partitioning.py @@ -1061,6 +1061,13 @@ def allocatePartitions(storage, disks, partitions, freespace): use_disk = None part_type = None growth = 0
# initialize the disklabel variable to None,
# so we can safely check if the variable was set or not
# (req_disks can be empty if using multipath with custom
# partitioning, in this case disklabel will not be set by the
# for loop and we need to check for that, as there are
# some check working with disklabel after the loop)
disklabel = None # loop through disks for _disk in req_disks: disklabel = disklabels[_disk.path]
@@ -1213,7 +1220,9 @@ def allocatePartitions(storage, disks, partitions, freespace): log.debug("found free space for bootable request") break
if getNextPartitionType(disklabel.partedDisk) is None:
# check if disklabel is set and if it is, check if the disk is
# out of partition slots (None = out of partition slots)
if disklabel is not None and getNextPartitionType(disklabel.partedDisk) is None: raise PartitioningError("no free partition slots on %s" % _disk.name)
-- 1.8.3.1
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
On Mon, 2013-10-14 at 16:32 +0200, Martin Kolman wrote:
The disklabel variable, needed by the partition slot check might not be set if multipath & custom partitioning is used. Therefore make sure the partition slot check is done only if disklabel is set.
Signed-off-by: Martin Kolman mkolman@redhat.com
storage/partitioning.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/storage/partitioning.py b/storage/partitioning.py index 1e7f583..79d2cc0 100644 --- a/storage/partitioning.py +++ b/storage/partitioning.py @@ -1061,6 +1061,13 @@ def allocatePartitions(storage, disks, partitions, freespace): use_disk = None part_type = None growth = 0
# initialize the disklabel variable to None,
# so we can safely check if the variable was set or not
# (req_disks can be empty if using multipath with custom
# partitioning, in this case disklabel will not be set by the
# for loop and we need to check for that, as there are
# some check working with disklabel after the loop)
disklabel = None
req_disks cannot be empty unless there are no disks available. See the else around line 1035, which sets req_disks to the full set of available disks if it was initially empty.
# loop through disks for _disk in req_disks: disklabel = disklabels[_disk.path]
@@ -1213,7 +1220,9 @@ def allocatePartitions(storage, disks, partitions, freespace): log.debug("found free space for bootable request") break
if getNextPartitionType(disklabel.partedDisk) is None:
# check if disklabel is set and if it is, check if the disk is
# out of partition slots (None = out of partition slots)
if disklabel is not None and getNextPartitionType(disklabel.partedDisk) is None: raise PartitioningError("no free partition slots on %s" % _disk.name)
If we arrive here and disklabel is not set we have bigger problems. Unfortunately this function is a huge mess, so this is not clear.
anaconda-patches@lists.fedorahosted.org