Skip to content

Commit

Permalink
Merge pull request #1278 from vojtechtrefny/main_factory-disk-ignore-log
Browse files Browse the repository at this point in the history
Log reason for ignoring disks in devicefactory
  • Loading branch information
vojtechtrefny committed Aug 28, 2024
2 parents 709884a + 6920687 commit 92a4427
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions blivet/devicefactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,16 @@ def configure(self):

# drop any new disks that don't have free space
min_free = min(Size("500MiB"), self.parent_factory.size)

for d in add_disks:
if not d.partitioned:
log.debug("Ignoring disk %s: disk is not partitioned", d.name)
elif not d.format.supported:
log.debug("Ignoring disk %s: format %s is not supported", d.name, d.format.name)
elif d.format.free < min_free:
log.debug("Ignoring disk %s: not enough free space. Required: %s, free: %s",
d.name, min_free, d.format.free)

add_disks = [d for d in add_disks if d.partitioned and
d.format.supported and d.format.free >= min_free]

Expand Down

0 comments on commit 92a4427

Please sign in to comment.