From 1264d77fd554e43ddfc1250707d5aba0ab16715e Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Thu, 22 Mar 2007 22:22:00 -0700 Subject: [PATCH] hush a pyflakes warning --- src/allmydata/test/check_memory.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/allmydata/test/check_memory.py b/src/allmydata/test/check_memory.py index 5cf3bfbc..0e99ec4e 100644 --- a/src/allmydata/test/check_memory.py +++ b/src/allmydata/test/check_memory.py @@ -1,6 +1,6 @@ #! /usr/bin/python -import sys, os, shutil +import os, shutil from twisted.internet import defer, reactor, protocol, error from twisted.application import service @@ -76,6 +76,15 @@ class SystemFramework: # the peers will start running, eventually they will connect to each # other and the queen + def touch_keepalive(self): + f = open(self.keepalive_file, "w") + f.write("If the node notices this file at startup, it will poll and\n") + f.write("terminate as soon as the file goes away. This prevents\n") + f.write("leaving processes around if the test harness has an\n") + f.write("internal failure and neglects to kil off the node\n") + f.write("itself. The contents of this file are ignored.\n") + f.close() + def start_client(self): log.msg("MAKING CLIENT") clientdir = self.clientdir = os.path.join(self.basedir, "client") @@ -85,13 +94,9 @@ class SystemFramework: f = open(os.path.join(clientdir, "roster_pburl"), "w") f.write(self.queen_pburl + "\n") f.close() - f = open(os.path.join(clientdir, "suicide_prevention_hotline"), "w") - f.write("If the node notices this file at startup, it will poll and\n") - f.write("terminate as soon as the file goes away. This prevents\n") - f.write("leaving processes around if the test harness has an\n") - f.write("internal failure and neglects to kil off the node\n") - f.write("itself. The contents of this file are ignored.\n") - f.close() + self.keepalive_file = os.path.join(clientdir, "suicide_prevention_hotline") + self.touch_keepalive() + # now start updating the mtime. pp = ClientWatcher() cmd = ["twistd", "-y", "client.tac"] -- 2.45.2