This commit is contained in:
Darko Poljak 2017-07-25 12:43:54 +02:00
parent d30b1a2f54
commit 7c7a98d083
2 changed files with 9 additions and 7 deletions

View file

@ -189,7 +189,7 @@ class Config(object):
if args.parallel: if args.parallel:
pargs = (host, host_tags, host_base_path, hostdir, args, True) pargs = (host, host_tags, host_base_path, hostdir, args, True)
log.trace(("Args for multiprocessing operation " log.trace(("Args for multiprocessing operation "
"for host {}: {}".format(host, pargs))) "for host {}: {}".format(host, pargs)))
process_args.append(pargs) process_args.append(pargs)
else: else:
try: try:
@ -209,13 +209,15 @@ class Config(object):
log.trace("Multiprocessing start method is {}".format( log.trace("Multiprocessing start method is {}".format(
multiprocessing.get_start_method())) multiprocessing.get_start_method()))
log.trace(("Starting multiprocessing Pool for {} " log.trace(("Starting multiprocessing Pool for {} "
"parallel host operation".format(args.parallel))) "parallel host operation".format(args.parallel)))
results = mp_pool_run(cls.onehost, process_args, jobs=args.parallel) results = mp_pool_run(cls.onehost,
process_args,
jobs=args.parallel)
log.trace(("Multiprocessing for parallel host operation " log.trace(("Multiprocessing for parallel host operation "
"finished")) "finished"))
log.trace(("Multiprocessing for parallel host operation " log.trace(("Multiprocessing for parallel host operation "
"results: {}", results)) "results: {}", results))
failed_hosts = [host for host, result in results if not result] failed_hosts = [host for host, result in results if not result]

View file

@ -368,8 +368,8 @@ class InventoryTag(Inventory):
tag, host)) tag, host))
host_tags.add(tag) host_tags.add(tag)
elif self.action == "del": elif self.action == "del":
self.log.debug("Deleting tag \'{}\' for host \'{}\'".format( self.log.debug("Deleting tag \'{}\' for host "
tag, host)) "\'{}\'".format(tag, host))
if tag in host_tags: if tag in host_tags:
host_tags.remove(tag) host_tags.remove(tag)
self.log.trace("new host tags: {}".format(host_tags)) self.log.trace("new host tags: {}".format(host_tags))