forked from ungleich-public/cdist
Default ssh mux options fixes.
This commit is contained in:
parent
215e58eb38
commit
b4ac23b4f8
1 changed files with 4 additions and 2 deletions
|
@ -22,6 +22,8 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
def inspect_ssh_mux_opts():
|
def inspect_ssh_mux_opts():
|
||||||
|
import subprocess
|
||||||
|
|
||||||
"""Inspect whether or not ssh supports multiplexing options"""
|
"""Inspect whether or not ssh supports multiplexing options"""
|
||||||
wanted_mux_opts = {
|
wanted_mux_opts = {
|
||||||
"ControlPath":"~/.ssh/master-%l-%r@%h:%p",
|
"ControlPath":"~/.ssh/master-%l-%r@%h:%p",
|
||||||
|
@ -38,13 +40,13 @@ def inspect_ssh_mux_opts():
|
||||||
for x in check:
|
for x in check:
|
||||||
try:
|
try:
|
||||||
subprocess.check_output("ssh -o {}".format(x),
|
subprocess.check_output("ssh -o {}".format(x),
|
||||||
stderr=subprocess.STDOUT)
|
stderr=subprocess.STDOUT, shell=True)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
foo = e.output.decode().lower()
|
foo = e.output.decode().lower()
|
||||||
if not "bad configuration option" in foo:
|
if not "bad configuration option" in foo:
|
||||||
for o in check[x]:
|
for o in check[x]:
|
||||||
mux_opts[o] = wanted_mux_opts[o]
|
mux_opts[o] = wanted_mux_opts[o]
|
||||||
foo = ["-o {}={}".format(x, mux_opts[x]) for x in mux_opts]
|
foo = [" -o {}={}".format(x, mux_opts[x]) for x in mux_opts]
|
||||||
return " ".join(foo)
|
return " ".join(foo)
|
||||||
|
|
||||||
def commandline():
|
def commandline():
|
||||||
|
|
Loading…
Reference in a new issue