From fa63bd9399a07c4b26affb3fc214291331d120b4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 24 Apr 2017 00:50:13 +0100 Subject: [PATCH] move cfg_get_raw into hippotatlib Signed-off-by: Ian Jackson --- hippotat | 3 --- hippotatlib/__init__.py | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hippotat b/hippotat index 379a184..f9395f2 100755 --- 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 diff --git a/hippotatlib/__init__.py b/hippotatlib/__init__.py index a4e7b69..7781c1f 100644 --- a/hippotatlib/__init__.py +++ b/hippotatlib/__init__.py @@ -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) -- 2.11.0