Specify location of netstat binary as a constant

This commit is contained in:
Seth Schoen 2015-02-13 15:14:01 -08:00
parent 67627c19d7
commit fbd9e6f0db
2 changed files with 5 additions and 1 deletions

View file

@ -66,3 +66,7 @@ IConfig.work_dir. Used for easy revocation."""
REC_TOKEN_DIR = "recovery_tokens"
"""Directory where all recovery tokens are saved (relative to
IConfig.work_dir)."""
NETSTAT = "/bin/netstat"
"""Location of netstat binary for checking whether a listener is already
running on the specified port (Linux-specific)."""

View file

@ -275,7 +275,7 @@ class StandaloneAuthenticator(object):
try:
proc = subprocess.Popen(
["/bin/netstat", "-nta", "--program"],
[constants.NETSTAT, "-nta", "--program"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, _ = proc.communicate()
if proc.wait() != 0: