Commit 4768f222 authored by Aaron Karper's avatar Aaron Karper

Use ternary operator instead of 5 lines

For the oStrictHostKeyChecking we use the variable tmp, which is yes or
no, depending on the strict.
Signed-off-by: default avatarAaron Karper <akarper@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 2b9ca708
......@@ -252,11 +252,7 @@ def GetSSHCommand(node, cmd, strict=True, opts=None, tty=False,
if tty:
args.append("-t")
if strict:
tmp = "yes"
else:
tmp = "no"
args.append("-oStrictHostKeyChecking=%s" % tmp)
args.append("-oStrictHostKeyChecking=%s" % ("yes" if strict else "no", ))
args.append("-oClearAllForwardings=yes")
args.append("-oForwardAgent=yes")
if opts:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment