[tor-commits] [nyx/master] Drop unused get_config_location()

atagar at torproject.org atagar at torproject.org
Sun Feb 14 02:55:49 UTC 2016


commit 4e885b2878145995735bec9819a9612136b93547
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Feb 6 12:41:45 2016 -0800

    Drop unused get_config_location()
---
 nyx/util/tor_config.py | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/nyx/util/tor_config.py b/nyx/util/tor_config.py
index fd610f7..8a382c9 100644
--- a/nyx/util/tor_config.py
+++ b/nyx/util/tor_config.py
@@ -4,7 +4,7 @@ Helper functions for working with tor's configuration file.
 
 from nyx.util import tor_controller
 
-from stem.util import conf, enum, str_tools, system
+from stem.util import conf, enum, str_tools
 
 CONFIG = conf.config_dict('nyx', {
   'torrc.alias': {},
@@ -48,26 +48,6 @@ ValidationError = enum.Enum('DUPLICATE', 'MISMATCH', 'IS_DEFAULT')
 MULTILINE_PARAM = None  # cached multiline parameters (lazily loaded)
 
 
-def get_config_location():
-  """
-  Provides the location of the torrc, raising an IOError with the reason if the
-  path can't be determined.
-  """
-
-  controller = tor_controller()
-  config_location = controller.get_info('config-file', None)
-  tor_pid, tor_prefix = controller.controller.get_pid(None), CONFIG['tor.chroot']
-
-  if not config_location:
-    raise IOError('unable to query the torrc location')
-
-  try:
-    tor_cwd = system.cwd(tor_pid)
-    return tor_prefix + system.expand_path(config_location, tor_cwd)
-  except IOError as exc:
-    raise IOError("querying tor's pwd failed because %s" % exc)
-
-
 def get_multiline_parameters():
   """
   Provides parameters that can be defined multiple times in the torrc without





More information about the tor-commits mailing list