chutney.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435
  1. diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
  2. index bf26978..73f4e5f 100644
  3. --- a/lib/chutney/TorNet.py
  4. +++ b/lib/chutney/TorNet.py
  5. @@ -682,7 +682,7 @@ class LocalNodeController(NodeController):
  6. def waitOnLaunch(self):
  7. """Check whether we can wait() for the tor process to launch"""
  8. # TODO: is this the best place for this code?
  9. - # RunAsDaemon default is 0
  10. + # RunAsDaemon default is 1
  11. runAsDaemon = False
  12. with open(self._getTorrcFname(), 'r') as f:
  13. for line in f.readlines():
  14. @@ -691,7 +691,7 @@ class LocalNodeController(NodeController):
  15. if len(stline) > 0:
  16. splline = stline.split()
  17. # if the line has at least two tokens on it
  18. - if (len(splline) > 0 and
  19. + if (len(splline) > 1 and
  20. splline[0].lower() == "RunAsDaemon".lower() and
  21. splline[1] == "1"):
  22. # use the RunAsDaemon value from the torrc
  23. @@ -874,9 +874,9 @@ class TorEnviron(chutney.Templating.Environ):
  24. ocp_line = ('__OwningControllerProcess %d' % (cpid))
  25. # if we want to leave the network running, or controlling_pid is 1
  26. # (or invalid)
  27. - if (os.environ.get('CHUTNEY_START_TIME', 0) < 0 or
  28. - os.environ.get('CHUTNEY_BOOTSTRAP_TIME', 0) < 0 or
  29. - os.environ.get('CHUTNEY_STOP_TIME', 0) < 0 or
  30. + if (int(os.environ.get('CHUTNEY_START_TIME', 0)) < 0 or
  31. + int(os.environ.get('CHUTNEY_BOOTSTRAP_TIME', 0)) < 0 or
  32. + int(os.environ.get('CHUTNEY_STOP_TIME', 0)) < 0 or
  33. cpid <= 1):
  34. return '#' + ocp_line
  35. else: