[tor-commits] [arm/master] Dropping --debug's _dumpConfig()

atagar at torproject.org atagar at torproject.org
Sun Sep 15 22:29:21 UTC 2013


commit b33dc49d9bccbdefd6ad182e58d389f5c798c77a
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Sep 15 12:30:58 2013 -0700

    Dropping --debug's _dumpConfig()
    
    The debug mode dumped both the arm and tor configurations to the debug file on
    the theory that more information was always better. However, in all the times
    I've troubleshot arm issues I've never found this information to be useful. As
    such, dropping it.
---
 arm/starter.py |   47 -----------------------------------------------
 1 file changed, 47 deletions(-)

diff --git a/arm/starter.py b/arm/starter.py
index e2eae69..e469443 100644
--- a/arm/starter.py
+++ b/arm/starter.py
@@ -47,9 +47,6 @@ CONFIG = stem.util.conf.config_dict("arm", {
   'msg.unable_to_read_config': '',
 })
 
-# torrc entries that are scrubbed when dumping
-PRIVATE_TORRC_ENTRIES = ["HashedControlPassword", "Bridge", "HiddenServiceDir"]
-
 # Makes subcommands provide us with English results (this is important so we
 # can properly parse it).
 
@@ -224,49 +221,6 @@ def _authenticate(controller, password):
     raise ValueError("Unable to authenticate: %s" % exc)
 
 
-def _dumpConfig():
-  """
-  Dumps the current arm and tor configurations at the DEBUG runlevel. This
-  attempts to scrub private information, but naturally the user should double
-  check that I didn't miss anything.
-  """
-  
-  config = stem.util.conf.get_config("arm")
-  conn = arm.util.torTools.getConn()
-  
-  # dumps arm's configuration
-  armConfigEntry = ""
-  armConfigKeys = list(config.keys())
-  armConfigKeys.sort()
-  
-  for configKey in armConfigKeys:
-    # Skips some config entries that are loaded by default. This fetches
-    # the config values directly to avoid misflagging them as being used by
-    # arm.
-    
-    if not configKey.startswith("config.summary.") and not configKey.startswith("torrc.") and not configKey.startswith("msg."):
-      armConfigEntry += "%s -> %s\n" % (configKey, config.get_value(configKey))
-  
-  if armConfigEntry: armConfigEntry = "Arm Configuration:\n%s" % armConfigEntry
-  else: armConfigEntry = "Arm Configuration: None"
-  
-  # dumps tor's version and configuration
-  torConfigEntry = "Tor (%s) Configuration:\n" % conn.getInfo("version", None)
-  
-  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:
-      torConfigEntry += "%s <scrubbed>\n" % key
-    else:
-      torConfigEntry += "%s %s\n" % (key, value)
-  
-  stem.util.log.debug(armConfigEntry.strip())
-  stem.util.log.debug(torConfigEntry.strip())
-
-
 def main():
   startTime = time.time()
 
@@ -402,7 +356,6 @@ def main():
   # dump tor and arm configuration when in debug mode
   if args.debug:
     stem.util.log.notice("Saving a debug log to '%s' (please check it for sensitive information before sharing)" % LOG_DUMP_PATH)
-    _dumpConfig()
   
   # Attempts to rename our process from "python setup.py <input args>" to
   # "arm <input args>"





More information about the tor-commits mailing list