summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Kuhl <kuhl@mtu.edu>2021-06-02 15:32:04 -0400
committerScott Kuhl <kuhl@mtu.edu>2021-06-02 15:32:04 -0400
commitd3f4889f21f2c7eeebae723c688361022e0f05b7 (patch)
treed6eb86792813d64f64b598dcf8084dccf4665ba3
parent560c6b4ce87df8513831d8ad352c524f48b192b3 (diff)
fix lint errors
-rw-r--r--sshuttle/hostwatch.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/sshuttle/hostwatch.py b/sshuttle/hostwatch.py
index aab1231..a016f4f 100644
--- a/sshuttle/hostwatch.py
+++ b/sshuttle/hostwatch.py
@@ -15,6 +15,8 @@ POLL_TIME = 60 * 15
NETSTAT_POLL_TIME = 30
CACHEFILE = os.path.expanduser('~/.sshuttle.hosts')
+# Have we already failed to write CACHEFILE?
+CACHE_WRITE_FAILED = False
hostnames = {}
queue = {}
@@ -29,7 +31,7 @@ except IOError:
def _is_ip(s):
return re.match(r'\d+\.\d+\.\d+\.\d+$', s)
-CACHE_WRITE_FAILED = False
+
def write_host_cache():
"""If possible, write our hosts file to disk so future connections
can reuse the hosts that we already found."""
@@ -50,7 +52,7 @@ def write_host_cache():
log("Failed to write host cache to temporary file "
"%s and rename it to %s" % (tmpname, CACHEFILE))
CACHE_WRITE_FAILED = True
-
+
try:
os.unlink(tmpname)
except BaseException:
@@ -134,7 +136,7 @@ def _check_revdns(ip):
found_host(r[0], ip)
except (OSError, socket.error, UnicodeError):
# This case is expected to occur regularly.
- #debug3('< %s gethostbyaddr failed on remote host' % ip)
+ # debug3('< %s gethostbyaddr failed on remote host' % ip)
pass