move cfg_get_raw into hippotatlib
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 23 Apr 2017 23:50:13 +0000 (00:50 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 23 Apr 2017 23:51:24 +0000 (00:51 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
hippotat
hippotatlib/__init__.py

index 379a184..f9395f2 100755 (executable)
--- a/hippotat
+++ b/hippotat
@@ -254,9 +254,6 @@ def process_cfg(_opts, putative_servers, putative_clients):
       c.max_queue_time  = srch(cfg.getint, 'max_queue_time')
       c.vroutes         = srch(cfg.get,    'vroutes')
 
-      def cfg_get_raw(*args, **kwargs):
-        return cfg.get(*args, raw=True, **kwargs)
-
       try: c.ifname     = srch(cfg_get_raw, 'ifname_client')
       except NoOptionError: pass
 
index a4e7b69..7781c1f 100644 (file)
@@ -484,6 +484,10 @@ def cfg_search_section(key,sections):
       return section
   raise NoOptionError(key, repr(sections))
 
+def cfg_get_raw(*args, **kwargs):
+  # for passing to cfg_search
+  return cfg.get(*args, raw=True, **kwargs)
+
 def cfg_search(getter,key,sections):
   section = cfg_search_section(key,sections)
   return getter(section, key)