diff --git a/flock/flock-cli b/flock/flock-cli index 4318a328..cade3856 100755 --- a/flock/flock-cli +++ b/flock/flock-cli @@ -84,6 +84,12 @@ def cleanup(name: str): except HypervisorStaleError: ctl.unlink() +@handler +def telnet(name: str): + for k,v in msg(name, { 1: None}).items(): + assert(k == -2) + os.execlp("telnet", "telnet", "localhost", str(v)) + @handler def container_start(hypervisor: str, name: str): print(f"start a machine {name} in {hypervisor}") @@ -102,9 +108,10 @@ def usage(name: str): f"\t creates .ctl in {DEFAULT_RUN_PATH}", f"\tstop stop Flock hypervisor", f"\tcleanup cleanup the control socket left behind a stale hypervisor", + f"\ttelnet run telnet to hypervisor", f"\tcontainer start start virtual machine", f"\tcontainer stop stop virtual machine", - f"\ttelnet run telnet to this machine", + f"\tcontainer telnet run telnet to this machine", sep="\n") cmd = []