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

[tor-commits] [nyx/master] Don't log notices about torrc issues



commit a77cb1658eae2fe92d445a599f6f32c35a4c6a8d
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Jan 17 13:23:49 2016 -0800

    Don't log notices about torrc issues
    
    This has been the #1 point of confusion with nyx. New users come onto irc all
    the time saying 'Zomg, arm says my torrc differs from tor's state. It also
    tells me exactly what to do. Somebody help me!!!'
    
    While torrc validation was a neat issue in practice it hasn't been good...
    
      * New users get scared by anything even hinting something could be wrong.
      * Experienced users just ignore the notices.
    
    It's not doing anyone any good, so just dropping 'em. Still debating if we'll
    include corrections on the torrc page itself.
---
 nyx/torrc_panel.py     |  1 -
 nyx/util/tor_config.py | 67 --------------------------------------------------
 2 files changed, 68 deletions(-)

diff --git a/nyx/torrc_panel.py b/nyx/torrc_panel.py
index 0ffb0d2..65dca26 100644
--- a/nyx/torrc_panel.py
+++ b/nyx/torrc_panel.py
@@ -64,7 +64,6 @@ class TorrcPanel(panel.Panel):
       try:
         loaded_torrc = tor_config.get_torrc()
         loaded_torrc.load(True)
-        loaded_torrc.log_validation_issues()
         self.redraw(True)
       except:
         pass
diff --git a/nyx/util/tor_config.py b/nyx/util/tor_config.py
index 4749223..1286a4a 100644
--- a/nyx/util/tor_config.py
+++ b/nyx/util/tor_config.py
@@ -472,70 +472,3 @@ class Torrc():
     """
 
     return self._vals_lock
-
-  def log_validation_issues(self):
-    """
-    Performs validation on the loaded contents, and logs warnings for issues
-    that are found.
-    """
-
-    corrections = self.get_corrections()
-
-    if corrections:
-      duplicate_options, default_options, mismatch_lines, missing_options = [], [], [], []
-
-      for line_number, issue, msg in corrections:
-        if issue == ValidationError.DUPLICATE:
-          duplicate_options.append('%s (line %i)' % (msg, line_number + 1))
-        elif issue == ValidationError.IS_DEFAULT:
-          default_options.append('%s (line %i)' % (msg, line_number + 1))
-        elif issue == ValidationError.MISMATCH:
-          mismatch_lines.append(line_number + 1)
-        elif issue == ValidationError.MISSING:
-          missing_options.append(msg)
-
-      if duplicate_options or default_options:
-        msg = "Unneeded torrc entries found. They've been highlighted in blue on the torrc page."
-
-        if duplicate_options:
-          if len(duplicate_options) > 1:
-            msg += '\n- entries ignored due to having duplicates: '
-          else:
-            msg += '\n- entry ignored due to having a duplicate: '
-
-          duplicate_options.sort()
-          msg += ', '.join(duplicate_options)
-
-        if default_options:
-          if len(default_options) > 1:
-            msg += '\n- entries match their default values: '
-          else:
-            msg += '\n- entry matches its default value: '
-
-          default_options.sort()
-          msg += ', '.join(default_options)
-
-        log.notice(msg)
-
-      if mismatch_lines or missing_options:
-        msg = "The torrc differs from what tor's using. You can issue a sighup to reload the torrc values by pressing x."
-
-        if mismatch_lines:
-          if len(mismatch_lines) > 1:
-            msg += '\n- torrc values differ on lines: '
-          else:
-            msg += '\n- torrc value differs on line: '
-
-          mismatch_lines.sort()
-          msg += ', '.join([str(val + 1) for val in mismatch_lines])
-
-        if missing_options:
-          if len(missing_options) > 1:
-            msg += '\n- configuration values are missing from the torrc: '
-          else:
-            msg += '\n- configuration value is missing from the torrc: '
-
-          missing_options.sort()
-          msg += ', '.join(missing_options)
-
-        log.warn(msg)



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