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

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



commit d00a61c31d60f781f8e795a10bf0187c6a722a54
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxx'
 TO_ADDRESSES = ['tor-consensus-health@xxxxxxxxxxxxxxxxxxxx']
 ERROR_ADDRESS = 'atagar@xxxxxxxxxxxxxx'
 
-TEST_RUN = False  # print script results rather than emailing
+TEST_RUN = getpass.getuser() != 'doctor'  # print script results rather than emailing
 
 
 def get_path(*comp):



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