[tor-commits] [arm/release] fix: --debug flag broke if config-text unavailable

atagar at torproject.org atagar at torproject.org
Sun Jul 17 06:08:20 UTC 2011


commit d6df7862474e728c31fea1edd9613a3e64dc73f8
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat May 21 13:59:20 2011 -0700

    fix: --debug flag broke if config-text unavailable
    
    When in debug mode arm attempted to log the results of 'GETINFO config-text'
    without taking into account that this call may fail (this is a new config
    option so this happens quite a bit). Caught by trogdor
---
 src/starter.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/starter.py b/src/starter.py
index 9268351..0454f9e 100644
--- a/src/starter.py
+++ b/src/starter.py
@@ -193,8 +193,9 @@ def _dumpConfig():
   # dumps tor's version and configuration
   torConfigEntry = "Tor (%s) Configuration:\n" % conn.getInfo("version")
   
-  for line in conn.getInfo("config-text").split("\n"):
-    if " " in line: key, value = line.split(" ", 1)
+  for line in conn.getInfo("config-text", "").split("\n"):
+    if not line: continue
+    elif " " in line: key, value = line.split(" ", 1)
     else: key, value = line, ""
     
     if key in PRIVATE_TORRC_ENTRIES:





More information about the tor-commits mailing list