Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reliability fixes #6

Merged
merged 2 commits into from Mar 15, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions snmp_passpersist.py
Expand Up @@ -226,6 +226,8 @@ def main_passpersist(self):
Direct call is unnecessary.
"""
line = sys.stdin.readline().strip()
if not line:
raise EOFError()

if 'PING' in line:
print "PONG"
Expand Down Expand Up @@ -254,6 +256,8 @@ def main_passpersist(self):
else:
print "NONE"

sys.stdout.flush()

def commit(self):
"""
Commit change made by the add_* methods.
Expand Down Expand Up @@ -366,6 +370,7 @@ def start(self, user_func, refresh):

# Start updater thread
up = threading.Thread(None,self.main_update,"Updater")
up.daemon = True
up.start()

# Main loop
Expand Down