Patchwork [7,of,8,ipv6] dummyssh: use LOCALIP

login
register
mail settings
Submitter Jun Wu
Date Feb. 16, 2017, 5:39 p.m.
Message ID <2bd74124ed8f3824f956.1487266759@localhost.localdomain>
Download mbox | patch
Permalink /patch/18567/
State Accepted
Headers show

Comments

Jun Wu - Feb. 16, 2017, 5:39 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1487229843 28800
#      Wed Feb 15 23:24:03 2017 -0800
# Node ID 2bd74124ed8f3824f956f301d15a6816bfa5d483
# Parent  ce9f5e640bdfcc6270f0be98d7fc6520740ba464
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 2bd74124ed8f
dummyssh: use LOCALIP

This patch replaces hard-coded 127.0.0.1 with $LOCALIP in dummyssh.

Patch

diff --git a/tests/dummyssh b/tests/dummyssh
--- a/tests/dummyssh
+++ b/tests/dummyssh
@@ -11,5 +11,5 @@  if sys.argv[1] != "user@dummy":
     sys.exit(-1)
 
-os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"
+os.environ["SSH_CLIENT"] = "%s 1 2" % os.environ.get('LOCALIP', '127.0.0.1')
 
 log = open("dummylog", "ab")