Permalink
Browse files

Add support for setting parallel pool_size

  • Loading branch information...
1 parent 2504348 commit dc01aba5a1182fcb00bcdae6637d36c196ecbe7a @philk philk committed Jan 18, 2013
Showing with 9 additions and 2 deletions.
  1. +5 −1 fix
  2. +1 −0 littlechef/__init__.py
  3. +3 −1 littlechef/runner.py
View
6 fix
@@ -97,7 +97,11 @@ else:
sys.argv.remove('--why-run')
if options.parallel:
littlechef.parallel = options.parallel
- sys.argv.remove('--parallel')
+ try:
+ sys.argv.remove('--parallel={0}'.format(options.parallel))
+ littlechef.pool_size = options.parallel
+ except ValueError:
+ sys.argv.remove('--parallel')
if options.verbose:
littlechef.verbose = True
sys.argv.remove('--verbose')
View
1 littlechef/__init__.py
@@ -27,6 +27,7 @@
LOGFILE = '/var/log/chef/solo.log'
whyrun = False
parallel = False
+pool_size = False
node_work_path = '/tmp/chef-solo'
cookbook_paths = ['site-cookbooks', 'cookbooks']
View
4 littlechef/runner.py
@@ -437,7 +437,9 @@ def _readconfig():
env.loglevel = littlechef.loglevel
env.verbose = littlechef.verbose
env.node_work_path = littlechef.node_work_path
-env.parallel = littlechef.parallel
+env.parallel = True if littlechef.parallel else False
+if littlechef.pool_size:
+ env.pool_size = int(littlechef.pool_size)
if littlechef.__cooking__:
# Called from command line

0 comments on commit dc01aba

Please sign in to comment.