[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [arm/master] We ignored the --interface argument if --socket was also provided



commit 4bb75e2ebc71a4a87bff5e47d6694a7610ae1689
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Jun 21 13:33:34 2014 -0700

    We ignored the --interface argument if --socket was also provided
    
    When a user specifies an endpoint (either a control port or socket file) we
    only try to connect to that. However, if a user supplies *both* an --interface
    and --socket argument then we ignored the former.
---
 arm/arguments.py |    2 +-
 arm/starter.py   |   18 +++++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arm/arguments.py b/arm/arguments.py
index b527564..136971e 100644
--- a/arm/arguments.py
+++ b/arm/arguments.py
@@ -8,7 +8,7 @@ import os
 
 import arm
 
-import stem.connection
+import stem.util.connection
 
 from arm.util import tor_controller, msg
 
diff --git a/arm/starter.py b/arm/starter.py
index e6db5cf..2131b8c 100644
--- a/arm/starter.py
+++ b/arm/starter.py
@@ -56,8 +56,16 @@ def main(config):
 
   _load_user_armrc(args.config)
 
-  control_port = None if args.user_provided_socket else (args.control_address, args.control_port)
-  control_socket = None if args.user_provided_port else args.control_socket
+  control_port = (args.control_address, args.control_port)
+  control_socket = args.control_socket
+
+  # If the user explicitely specified an endpoint then just try to connect to
+  # that.
+
+  if args.user_provided_socket and not args.user_provided_port:
+    control_port = None
+  elif args.user_provided_port and not args.user_provided_socket:
+    control_socket = None
 
   controller = init_controller(
     control_port = control_port,
@@ -96,8 +104,8 @@ def main(config):
 
 def _setup_debug_logging(args):
   """
-  Configures us to log at stem's trace level to debug log path, and notes some
-  general diagnostic information.
+  Configures us to log at stem's trace level to a debug log path. This starts
+  it off with some general diagnostic information.
   """
 
   debug_dir = os.path.dirname(args.debug_path)
@@ -251,7 +259,7 @@ def _use_unicode(config):
   if not config.get('features.printUnicode', True):
     return
 
-  is_lang_unicode = "utf-" in os.getenv("LANG", "").lower()
+  is_lang_unicode = 'utf-' in os.getenv('LANG', '').lower()
 
   if is_lang_unicode and arm.util.ui_tools.is_wide_characters_supported():
     locale.setlocale(locale.LC_ALL, '')



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits