Skip to content

Commit

Permalink
support virt.Guest() with no partitions
Browse files Browse the repository at this point in the history
Default to using all space for '/'.

Signed-off-by: Jiri Jaburek <[email protected]>
  • Loading branch information
comps committed Oct 7, 2024
1 parent 63e06c9 commit b51543e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/virt.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,15 @@ def __init__(self, template=TEMPLATE, packages=PACKAGES, partitions=None):
self.ks = template
self.appends = []
self.packages = packages
self.partitions = partitions if partitions else []
self.partitions = partitions

def assemble(self):
partitions_block = '\n'.join(
(f'part {mountpoint} --size={size}' for mountpoint, size in self.partitions),
)
if self.partitions:
partitions_block = '\n'.join(
(f'part {mountpoint} --size={size}' for mountpoint, size in self.partitions),
)
else:
partitions_block = 'part / --size=1 --grow'
appends_block = '\n'.join(self.appends)
packages_block = '\n'.join(self.packages)
packages_block = f'%packages\n{packages_block}\n%end'
Expand Down

0 comments on commit b51543e

Please sign in to comment.