Skip to content

Commit

Permalink
Merge pull request #2082 from Chris-Peterson444/kvm-test-rearrange-disks
Browse files Browse the repository at this point in the history
kvm-test: set cloud-config disk after real disks
  • Loading branch information
Chris-Peterson444 authored Sep 16, 2024
2 parents 6727905 + b005a69 commit 207edf1
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions scripts/kvm-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,21 +577,6 @@ def install(ctx):
kvm.append('-nographic')
appends.append('console=ttyS0')

if ctx.args.cloud_config is not None or ctx.args.cloud_config_default:
if ctx.args.cloud_config is not None:
ctx.cloudconfig = ctx.args.cloud_config.read()
kvm.extend(drive(create_seed(ctx.cloudconfig, tempdir), 'raw'))
if ctx.args.autoinstall is None:
# Let's inspect the yaml and check if there is an autoinstall
# section.
autoinstall = "autoinstall" in yaml.safe_load(ctx.cloudconfig)
else:
autoinstall = ctx.args.autoinstall

if autoinstall:
appends.append('autoinstall')


if ctx.args.update:
appends.append('subiquity-channel=' + ctx.args.update)

Expand All @@ -608,6 +593,20 @@ def install(ctx):
disksize = ctx.args.disksize or ctx.default_disk_size
run(f'qemu-img create -f qcow2 {ctx.target} {disksize}')

if ctx.args.cloud_config is not None or ctx.args.cloud_config_default:
if ctx.args.cloud_config is not None:
ctx.cloudconfig = ctx.args.cloud_config.read()
kvm.extend(drive(create_seed(ctx.cloudconfig, tempdir), 'raw'))
if ctx.args.autoinstall is None:
# Let's inspect the yaml and check if there is an autoinstall
# section.
autoinstall = "autoinstall" in yaml.safe_load(ctx.cloudconfig)
else:
autoinstall = ctx.args.autoinstall

if autoinstall:
appends.append('autoinstall')

if len(appends) > 0:
with mounter(iso, mntdir):
# if we're passing kernel args, we need to manually specify
Expand Down

0 comments on commit 207edf1

Please sign in to comment.