Merge remote-tracking branch 'telmich/master'

This commit is contained in:
Steven Armstrong 2011-10-07 18:48:18 +02:00
commit 0f9d71423a
3 changed files with 41 additions and 32 deletions

View file

@ -31,30 +31,3 @@ log = logging.getLogger(__name__)
class Config(cdist.config_install.ConfigInstall):
pass
def config(args):
"""Configure remote system"""
process = {}
time_start = datetime.datetime.now()
os.environ['__remote_exec'] = "ssh -o User=root -q"
os.environ['__remote_copy'] = "scp -o User=root -q"
for host in args.host:
c = Config(host, initial_manifest=args.manifest, base_path=args.cdist_home, debug=args.debug)
if args.parallel:
log.debug("Creating child process for %s", host)
process[host] = multiprocessing.Process(target=c.deploy_and_cleanup)
process[host].start()
else:
c.deploy_and_cleanup()
if args.parallel:
for p in process.keys():
log.debug("Joining process %s", p)
process[p].join()
time_end = datetime.datetime.now()
log.info("Total processing time for %s host(s): %s", len(args.host),
(time_end - time_start).total_seconds())

View file

@ -90,13 +90,13 @@ class ConfigInstall:
# Submit debug flag to manifest, can be used by emulator and types
if self.debug:
env['__debug'] = "yes"
env['__debug'] = "yes"
# Required for recording source in emulator
env['__cdist_manifest'] = manifest_path
# Required to find types in emulator
env['__cdist_type_base_path'] = self.context.type_base_path
env['__cdist_type_base_path'] = self.context.type_base_path
# Other environment stuff
if extra_env:
@ -105,7 +105,7 @@ class ConfigInstall:
cdist.exec.shell_run_or_debug_fail(manifest_path, [manifest_path], env=env)
def object_run(self, cdist_object):
"""Run gencode or code for an object"""
"""Run gencode and code for an object"""
log.debug("Running object %s", cdist_object)
# Catch requirements, which re-call us