Skip to content
Snippets Groups Projects
Verified Commit fe46cab7 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch 'master' into 19-create-meetings-in-cli

parents 591d35c3 3029bb3e
No related branches found
No related tags found
No related merge requests found
from getpass import getuser from getpass import getuser
from pathlib import Path from pathlib import Path
import sys
from typing import Optional, TextIO, Tuple from typing import Optional, TextIO, Tuple
from urllib.parse import urlparse from urllib.parse import urlparse
...@@ -186,10 +185,12 @@ def system(ctx): ...@@ -186,10 +185,12 @@ def system(ctx):
def ssh(ctx, command: Tuple[str]): def ssh(ctx, command: Tuple[str]):
"""Execute command via ssh on all hosts.""" """Execute command via ssh on all hosts."""
# Consume stdin completely to multiplex it # Consume stdin completely to multiplex it
stdin = sys.stdin.read() stdin = click.get_text_stream('stdin')
stdout = click.get_text_stream('stdout')
stderr = click.get_text_stream('stderr')
res = ctx.obj["apis"].ssh_command(command, stdin) res = ctx.obj["apis"].ssh_command(command, stdin.read())
for name, output in res.items(): for name, output in res.items():
sys.stdout.write(output.stdout) stdout.write(output.stdout)
sys.stderr.write(output.stderr) stderr.write(output.stderr)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment