[tor-commits] [doctor/master] Pick dry-run status based on user

atagar at torproject.org atagar at torproject.org
Wed Jan 18 21:09:44 UTC 2017


commit d00a61c31d60f781f8e795a10bf0187c6a722a54
Author: Damian Johnson <atagar at torproject.org>
Date:   Mon Jan 16 10:44:14 2017 -0800

    Pick dry-run status based on user
    
    Rather than hardcoding this flag to True when developing why not simply base it
    on our user? The doctor virt is usually the only place we want this to be
    'False'.
---
 util.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/util.py b/util.py
index 9d4adcb..fc9601c 100644
--- a/util.py
+++ b/util.py
@@ -2,6 +2,7 @@
 Module for issuing email notifications to me via gmail.
 """
 
+import getpass
 import logging
 import os
 import socket
@@ -17,7 +18,7 @@ FROM_ADDRESS = 'atagar at torproject.org'
 TO_ADDRESSES = ['tor-consensus-health at lists.torproject.org']
 ERROR_ADDRESS = 'atagar at torproject.org'
 
-TEST_RUN = False  # print script results rather than emailing
+TEST_RUN = getpass.getuser() != 'doctor'  # print script results rather than emailing
 
 
 def get_path(*comp):





More information about the tor-commits mailing list