[tor-commits] [chutney/master] TorNet: Simplify the OwningControllerProcess code

teor at torproject.org teor at torproject.org
Sat Mar 30 02:20:59 UTC 2019


commit ce93bf0c4d77d6f95148b80e54c1294f6b83b912
Author: teor <teor at torproject.org>
Date:   Sat Mar 30 10:34:03 2019 +1000

    TorNet: Simplify the OwningControllerProcess code
    
    Cleanup after 27947.
---
 lib/chutney/TorNet.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 4fd58b1..b0061b6 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -904,9 +904,7 @@ DEFAULTS = {
                                  getenv_int('BOOTSTRAP_TIME',
                                             60)),
     # the PID of the controlling script (for __OwningControllerProcess)
-    'controlling_pid': (getenv_int('CHUTNEY_CONTROLLING_PID', None)
-                        if 'CHUTNEY_CONTROLLING_PID' in os.environ
-                        else None),
+    'controlling_pid': getenv_int('CHUTNEY_CONTROLLING_PID', 0),
     # a DNS config file (for ServerDNSResolvConfFile)
     'dns_conf': (os.environ.get('CHUTNEY_DNS_CONF', '/etc/resolv.conf')
                         if 'CHUTNEY_DNS_CONF' in os.environ
@@ -1015,8 +1013,6 @@ class TorEnviron(chutney.Templating.Environ):
 
     def _get_owning_controller_process(self, my):
         cpid = my['controlling_pid']
-        if cpid is None:
-            cpid = 0
         ocp_line = ('__OwningControllerProcess %d' % (cpid))
         # if we want to leave the network running, or controlling_pid is 1
         # (or invalid)



More information about the tor-commits mailing list