Add jobs option for parallel execution, global explorers first.

This commit is contained in:
Darko Poljak 2016-08-11 23:54:31 +02:00
commit a4c49201c0
4 changed files with 89 additions and 8 deletions

View file

@ -70,15 +70,16 @@ def inspect_ssh_mux_opts():
class Config(object):
"""Cdist main class to hold arbitrary data"""
def __init__(self, local, remote, dry_run=False):
def __init__(self, local, remote, dry_run=False, jobs=None):
self.local = local
self.remote = remote
self.log = logging.getLogger(self.local.target_host)
self.dry_run = dry_run
self.jobs = jobs
self.explorer = core.Explorer(self.local.target_host, self.local,
self.remote)
self.remote, jobs=self.jobs)
self.manifest = core.Manifest(self.local.target_host, self.local)
self.code = core.Code(self.local.target_host, self.local, self.remote)
@ -241,7 +242,7 @@ class Config(object):
remote_exec=remote_exec,
remote_copy=remote_copy)
c = cls(local, remote, dry_run=args.dry_run)
c = cls(local, remote, dry_run=args.dry_run, jobs=args.jobs)
c.run()
except cdist.Error as e: