chiark / gitweb /
pass opts to process_cfg
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 5 Apr 2017 13:01:02 +0000 (14:01 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 5 Apr 2017 13:01:02 +0000 (14:01 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
hippotat
hippotatd
hippotatlib/__init__.py

index 82e1bee..3b25bfd 100755 (executable)
--- a/hippotat
+++ b/hippotat
@@ -233,7 +233,7 @@ class Client():
 
 clients = [ ]
 
-def process_cfg(putative_servers, putative_clients):
+def process_cfg(_opts, putative_servers, putative_clients):
   global clients
 
   for ss in putative_servers.values():
index aefa458..ec47c1d 100755 (executable)
--- a/hippotatd
+++ b/hippotatd
@@ -286,7 +286,10 @@ def start_http():
 
 #---------- config and setup ----------
 
-def process_cfg(putative_servers, putative_clients):
+def process_cfg(_opts, putative_servers, putative_clients):
+  global opts
+  opts = _opts
+
   global c
   c = ConfigResults()
   c.server = cfg.get('SERVER','server')
index 8a26bee..701a5f2 100644 (file)
@@ -634,7 +634,7 @@ just `+': all DFLAGs.
 
   try:
     (pss, pcs) = _cfg_process_putatives()
-    process_cfg(pss, pcs)
+    process_cfg(opts, pss, pcs)
   except (configparser.Error, ValueError):
     traceback.print_exc(file=sys.stderr)
     print('\nInvalid configuration, giving up.', file=sys.stderr)