refactor(cli): rename vmgui command to vmware
Rename the GUI launcher command from `vmgui` to `vmware` (`ci vmware ...`). Updates the click command name, function, log-file prefix, __main__ registration, tests and runbook references. Behaviour unchanged.
This commit is contained in:
@@ -23,7 +23,7 @@ from ci_orchestrator.commands.retention import retention
|
||||
from ci_orchestrator.commands.smoke import smoke
|
||||
from ci_orchestrator.commands.template import template
|
||||
from ci_orchestrator.commands.validate import validate
|
||||
from ci_orchestrator.commands.vm import vm, vmgui
|
||||
from ci_orchestrator.commands.vm import vm, vmware
|
||||
|
||||
# Re-export so legacy A1 tests that patched ``cli_module.<name>`` keep working.
|
||||
from ci_orchestrator.commands.wait import ( # noqa: F401 (intentional re-exports)
|
||||
@@ -54,7 +54,7 @@ cli.add_command(bench)
|
||||
cli.add_command(smoke)
|
||||
cli.add_command(validate)
|
||||
cli.add_command(creds)
|
||||
cli.add_command(vmgui)
|
||||
cli.add_command(vmware)
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
|
||||
@@ -534,7 +534,7 @@ def _launch_gui(argv: list[str], env: dict[str, str], log_path: Path) -> subproc
|
||||
)
|
||||
|
||||
|
||||
@click.command("vmgui")
|
||||
@click.command("vmware")
|
||||
@click.option(
|
||||
"--vmx",
|
||||
"--vm-path",
|
||||
@@ -575,7 +575,7 @@ def _launch_gui(argv: list[str], env: dict[str, str], log_path: Path) -> subproc
|
||||
default=None,
|
||||
help="X display to use (default: inherit $DISPLAY). e.g. ':0'.",
|
||||
)
|
||||
def vmgui(
|
||||
def vmware(
|
||||
vmx: str | None,
|
||||
vmware_path: str,
|
||||
power_on: bool,
|
||||
@@ -619,7 +619,7 @@ def vmgui(
|
||||
if xauth and not os.access(xauth, os.R_OK):
|
||||
env.pop("XAUTHORITY", None)
|
||||
click.echo(
|
||||
f"[vmgui] dropping unreadable XAUTHORITY ({xauth}); relying on xhost.",
|
||||
f"[vmware] dropping unreadable XAUTHORITY ({xauth}); relying on xhost.",
|
||||
err=True,
|
||||
)
|
||||
|
||||
@@ -644,14 +644,14 @@ def vmgui(
|
||||
argv.append(str(vmx_path))
|
||||
elif power_on or fullscreen:
|
||||
click.echo(
|
||||
"[vmgui] note: --power-on/--fullscreen ignored without --vmx.",
|
||||
"[vmware] note: --power-on/--fullscreen ignored without --vmx.",
|
||||
err=True,
|
||||
)
|
||||
|
||||
ts = datetime.now(tz=UTC).strftime("%Y%m%d-%H%M%S")
|
||||
log_path = Path(tempfile.gettempdir()) / f"vmgui-{os.getpid()}-{ts}.log"
|
||||
log_path = Path(tempfile.gettempdir()) / f"vmware-{os.getpid()}-{ts}.log"
|
||||
|
||||
click.echo(f"[vmgui] launching VMware GUI: {' '.join(argv)}")
|
||||
click.echo(f"[vmware] launching VMware GUI: {' '.join(argv)}")
|
||||
try:
|
||||
proc = _launch_gui(argv, env, log_path)
|
||||
except (OSError, ValueError) as exc:
|
||||
@@ -672,8 +672,8 @@ def vmgui(
|
||||
)
|
||||
|
||||
click.echo(
|
||||
f"[vmgui] VMware GUI started (pid {proc.pid}); display={disp}; log={log_path}"
|
||||
f"[vmware] VMware GUI started (pid {proc.pid}); display={disp}; log={log_path}"
|
||||
)
|
||||
|
||||
|
||||
__all__ = ["cleanup_orphans", "vm", "vmgui"]
|
||||
__all__ = ["cleanup_orphans", "vm", "vmware"]
|
||||
|
||||
Reference in New Issue
Block a user