mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-27 23:33:30 +00:00
nixos/lib/test-driver: remove legacy args handling
Scheduled for removal in 24.11, so let's follow through. Added in #291544. (cherry picked from commit71306e6b36
) (cherry picked from commit8427b6f640
)
This commit is contained in:
parent
cec59f9c70
commit
a92ea1ff26
@ -211,43 +211,6 @@ class Driver:
|
||||
name: str | None = None,
|
||||
keep_vm_state: bool = False,
|
||||
) -> Machine:
|
||||
# Legacy args handling
|
||||
# FIXME: remove after 24.05
|
||||
if isinstance(start_command, dict):
|
||||
if name is not None or keep_vm_state:
|
||||
raise TypeError(
|
||||
"Dictionary passed to create_machine must be the only argument"
|
||||
)
|
||||
|
||||
args = start_command
|
||||
start_command = args.pop("startCommand", SENTINEL)
|
||||
|
||||
if start_command is SENTINEL:
|
||||
raise TypeError(
|
||||
"Dictionary passed to create_machine must contain startCommand"
|
||||
)
|
||||
|
||||
if not isinstance(start_command, str):
|
||||
raise TypeError(
|
||||
f"startCommand must be a string, got: {repr(start_command)}"
|
||||
)
|
||||
|
||||
name = args.pop("name", None)
|
||||
keep_vm_state = args.pop("keep_vm_state", False)
|
||||
|
||||
if args:
|
||||
raise TypeError(
|
||||
f"Unsupported arguments passed to create_machine: {args}"
|
||||
)
|
||||
|
||||
self.logger.warning(
|
||||
Fore.YELLOW
|
||||
+ Style.BRIGHT
|
||||
+ "WARNING: Using create_machine with a single dictionary argument is deprecated and will be removed in NixOS 24.11"
|
||||
+ Style.RESET_ALL
|
||||
)
|
||||
# End legacy args handling
|
||||
|
||||
tmp_dir = get_tmp_dir()
|
||||
|
||||
cmd = NixStartScript(start_command)
|
||||
|
Loading…
Reference in New Issue
Block a user