Add missing configuration arg

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

View file

@ -140,7 +140,7 @@ class Config(object):
# Determine forcing IPv4/IPv6 options if any, only for # Determine forcing IPv4/IPv6 options if any, only for
# default remote commands. # default remote commands.
if hasattr(args, 'force_ipv') and args.force_ipv: if args.force_ipv:
force_addr_opt = " -{}".format(args.force_ipv) force_addr_opt = " -{}".format(args.force_ipv)
else: else:
force_addr_opt = "" force_addr_opt = ""
@ -353,15 +353,12 @@ class Config(object):
@staticmethod @staticmethod
def _address_family(args): def _address_family(args):
if hasattr(args, 'force_ipv'):
if args.force_ipv == 4: if args.force_ipv == 4:
family = socket.AF_INET family = socket.AF_INET
elif args.force_ipv == 6: elif args.force_ipv == 6:
family = socket.AF_INET6 family = socket.AF_INET6
else: else:
family = 0 family = 0
else:
family = 0
return family return family
@staticmethod @staticmethod

View file

@ -200,8 +200,11 @@ class TriggerHttp(http.server.BaseHTTPRequestHandler):
log.debug("Executing cdist onehost with params: %s, %s, %s, %s, %s, ", log.debug("Executing cdist onehost with params: %s, %s, %s, %s, %s, ",
target_host, host_tags, host_base_path, hostdir, target_host, host_tags, host_base_path, hostdir,
self.cdistargs) self.cdistargs)
cfg = cdist.configuration.Configuration(self.cdistargs)
configuration = cfg.get_config(section='GLOBAL')
theclass.onehost(target_host, host_tags, host_base_path, hostdir, 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): class HTTPServerV6(socketserver.ForkingMixIn, http.server.HTTPServer):