Skip to content

Commit

Permalink
Remove network_overrides if empty for backcompat
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Laucius <[email protected]>
  • Loading branch information
andrewla committed Jan 15, 2025
1 parent 837e744 commit 7e2c75f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/framework/microvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,12 +1004,20 @@ def restore_from_snapshot(
for k, v in rename_interfaces.items()
]

optional_kwargs = {}
if network_overrides:
# For backwards compatibility ab testing we want to avoid adding
# new parameters until we have a release baseline with the new
# parameter. Once the release baseline has moved, this assignment
# can be inline in the snapshot_load command below
optional_kwargs["network_overrides"] = network_overrides

self.api.snapshot_load.put(
mem_backend=mem_backend,
snapshot_path=str(jailed_vmstate),
enable_diff_snapshots=snapshot.is_diff,
resume_vm=resume,
network_overrides=iface_overrides,
**optional_kwargs,
)
# This is not a "wait for boot", but rather a "VM still works after restoration"
if snapshot.net_ifaces and resume:
Expand Down

0 comments on commit 7e2c75f

Please sign in to comment.