Add missing configuration arg

This commit is contained in:
Darko Poljak 2019-01-28 16:35:02 +01:00
parent c19f12904d
commit c0eb1e0af9
2 changed files with 9 additions and 9 deletions

View file

@ -143,7 +143,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 = ""
@ -356,13 +356,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

View file

@ -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):