From 1a5cc67cc8f16262806697978313f0855872eab6 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Mon, 28 Jan 2019 16:35:02 +0100 Subject: [PATCH] Add missing configuration arg --- cdist/config.py | 13 +++++-------- cdist/trigger.py | 5 ++++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cdist/config.py b/cdist/config.py index 44afe7d5..97cc1da6 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -144,7 +144,7 @@ class Config(object): # Determine forcing IPv4/IPv6 options if any, only for # default remote commands. - if hasattr(args, 'force_ipv') and args.force_ipv: + if args.force_ipv: force_addr_opt = " -{}".format(args.force_ipv) else: force_addr_opt = "" @@ -357,13 +357,10 @@ class Config(object): @staticmethod def _address_family(args): - if hasattr(args, 'force_ipv'): - if args.force_ipv == 4: - family = socket.AF_INET - elif args.force_ipv == 6: - family = socket.AF_INET6 - else: - family = 0 + if args.force_ipv == 4: + family = socket.AF_INET + elif args.force_ipv == 6: + family = socket.AF_INET6 else: family = 0 return family diff --git a/cdist/trigger.py b/cdist/trigger.py index 1b9a384b..58f98dca 100644 --- a/cdist/trigger.py +++ b/cdist/trigger.py @@ -200,8 +200,11 @@ class TriggerHttp(http.server.BaseHTTPRequestHandler): log.debug("Executing cdist onehost with params: %s, %s, %s, %s, %s, ", target_host, host_tags, host_base_path, hostdir, self.cdistargs) + cfg = cdist.configuration.Configuration(self.cdistargs) + configuration = cfg.get_config(section='GLOBAL') theclass.onehost(target_host, host_tags, host_base_path, hostdir, - self.cdistargs, parallel=False) + self.cdistargs, parallel=False, + configuration=configuration) class HTTPServerV6(socketserver.ForkingMixIn, http.server.HTTPServer):