mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 18:44:54 +00:00
Merge pull request #10618 from louis-oui/topo-win-title
topotests: fix the usage of screen
This commit is contained in:
commit
f8ce626944
@ -358,11 +358,14 @@ class Commander(object): # pylint: disable=R0205
|
||||
# wait for not supported in screen for now
|
||||
channel = None
|
||||
cmd = [self.get_exec_path("screen")]
|
||||
if title:
|
||||
cmd.append("-t")
|
||||
cmd.append(title)
|
||||
if not os.path.exists(
|
||||
"/run/screen/S-{}/{}".format(os.environ["USER"], os.environ["STY"])
|
||||
):
|
||||
cmd = ["sudo", "-u", os.environ["SUDO_USER"]] + cmd
|
||||
cmd.append(nscmd)
|
||||
cmd.extend(nscmd.split(" "))
|
||||
elif "DISPLAY" in os.environ:
|
||||
# We need it broken up for xterm
|
||||
user_cmd = cmd
|
||||
|
@ -113,11 +113,11 @@ def doline(unet, line, writef):
|
||||
hosts = [unet.hosts[x] for x in args]
|
||||
for host in hosts:
|
||||
if cmd == "t" or cmd == "term":
|
||||
host.run_in_window("bash")
|
||||
host.run_in_window("bash", title="sh-%s" % host)
|
||||
elif cmd == "v" or cmd == "vtysh":
|
||||
host.run_in_window("vtysh")
|
||||
host.run_in_window("vtysh", title="vt-%s" % host)
|
||||
elif cmd == "x" or cmd == "xterm":
|
||||
host.run_in_window("bash", forcex=True)
|
||||
host.run_in_window("bash", title="sh-%s" % host, forcex=True)
|
||||
elif cmd == "sh":
|
||||
hosts, cmd = host_cmd_split(unet, oargs)
|
||||
for host in hosts:
|
||||
|
@ -1613,7 +1613,7 @@ class Router(Node):
|
||||
|
||||
shell_routers = g_extra_config["shell"]
|
||||
if "all" in shell_routers or self.name in shell_routers:
|
||||
self.run_in_window(os.getenv("SHELL", "bash"))
|
||||
self.run_in_window(os.getenv("SHELL", "bash"), title="sh-%s" % self.name)
|
||||
|
||||
if self.daemons["eigrpd"] == 1:
|
||||
eigrpd_path = os.path.join(self.daemondir, "eigrpd")
|
||||
@ -1631,7 +1631,7 @@ class Router(Node):
|
||||
|
||||
vtysh_routers = g_extra_config["vtysh"]
|
||||
if "all" in vtysh_routers or self.name in vtysh_routers:
|
||||
self.run_in_window("vtysh")
|
||||
self.run_in_window("vtysh", title="vt-%s" % self.name)
|
||||
|
||||
return status
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user