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

[tor-commits] [ooni-probe/master] Expand the user (~) fragment when creating directory



commit 2c01f11c1d7d3fdc1ecf9bc967f7a830257d34e8
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Tue Jan 8 21:11:20 2013 +0100

    Expand the user (~) fragment when creating directory
---
 ooni/runner.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/ooni/runner.py b/ooni/runner.py
index 1a7e629..19d7e1f 100644
--- a/ooni/runner.py
+++ b/ooni/runner.py
@@ -529,10 +529,12 @@ def startTor():
         config.tor.socks_port = socks_port
 
     if config.tor.data_dir:
-        if not os.path.exists(config.tor.data_dir):
-            log.msg("%s does not exist. Creating it." % config.tor.data_dir)
-            os.makedirs(config.tor.data_dir)
-        tor_config.DataDirectory = os.path.expanduser(config.tor.data_dir)
+        data_dir = os.path.expanduser(config.tor.data_dir)
+
+        if not os.path.exists(data_dir):
+            log.msg("%s does not exist. Creating it." % data_dir)
+            os.makedirs(data_dir)
+        tor_config.DataDirectory = data_dir
 
     tor_config.save()
 



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