From eb78d9b03444635469d3b7e4cfa6c1afc8a3aecf 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 bf7c3767..bc05a28c 100644 --- a/cdist/config.py +++ b/cdist/config.py @@ -140,7 +140,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 = "" @@ -353,13 +353,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):