[tor-commits] [arm/release] Logging where we place the generated torrc

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


commit 49ff021c97b9a4400730f3ee769beec74add50fa
Author: Damian Johnson <atagar at torproject.org>
Date:   Tue Jul 12 10:21:45 2011 -0700

    Logging where we place the generated torrc
---
 src/cli/wizard.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/cli/wizard.py b/src/cli/wizard.py
index 8f3d0d1..032cb92 100644
--- a/src/cli/wizard.py
+++ b/src/cli/wizard.py
@@ -333,14 +333,23 @@ def showWizard():
           log.log(log.INFO, "Writing torrc to '%s':\n%s" % (torrcLocation, generatedTorrc))
           
           # if the torrc already exists then save it to a _bak file
+          isBackedUp = False
           if os.path.exists(torrcLocation):
             shutil.copy(torrcLocation, torrcLocation + "_bak")
+            isBackedUp = True
           
           # writes the torrc contents
           torrcFile = open(torrcLocation, "w")
           torrcFile.write(generatedTorrc)
           torrcFile.close()
           
+          # logs where we placed the torrc
+          msg = "Tor configuration placed at '%s'" % torrcLocation
+          if isBackedUp:
+            msg += " (the previous torrc was moved to 'torrc_bak')"
+          
+          log.log(log.NOTICE, msg)
+          
           dataDir = cli.controller.getController().getDataDirectory()
           
           pathPrefix = os.path.dirname(sys.argv[0])





More information about the tor-commits mailing list