From 71e088fbb42dbbb899dfe73989c306609a9b1135 Mon Sep 17 00:00:00 2001 From: Jernej Jakob Date: Thu, 11 Jun 2020 09:02:35 +0200 Subject: host_name: T2486: move Config() call into main Init Config once in main() and pass it to both get_config() and verify(). --- src/conf_mode/host_name.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/conf_mode/host_name.py') diff --git a/src/conf_mode/host_name.py b/src/conf_mode/host_name.py index a71f9f88f..4652050ab 100755 --- a/src/conf_mode/host_name.py +++ b/src/conf_mode/host_name.py @@ -45,8 +45,7 @@ default_config_data = { 'static_host_mapping': {} } -def get_config(): - conf = Config() +def get_config(conf): hosts = copy.deepcopy(default_config_data) if conf.exists("system host-name"): @@ -176,8 +175,9 @@ def apply(config): if __name__ == '__main__': try: - c = get_config() - verify(c) + conf = Config() + c = get_config(conf) + verify(conf, c) generate(c) apply(c) except ConfigError as e: -- cgit v1.2.3