Permalink
Browse files

Added ability to specify more than one folder of cookbooks. They will…

… get collapsed into a single one before uploading
  • Loading branch information...
1 parent 875330f commit 21ea5fe1606b5fc459ccc53a68b3eb3efacedf5c @flashingpumpkin flashingpumpkin committed Dec 1, 2011
Showing with 10 additions and 3 deletions.
  1. +10 −3 provision/__init__.py
View
@@ -7,11 +7,11 @@
import sys
import tempfile
-__version__ = '0.0.2'
+__version__ = '0.0.3'
DEFAULTS = dict(
path='/var/chef',
- cookbooks='cookbooks',
+ cookbooks=['cookbooks'],
log_level='info',
gems='1.8.10',
recipes=[],
@@ -79,7 +79,14 @@ def upload():
tmpfolder = tempfile.mkdtemp()
- local('mkdir %s/cookbooks && cp -r %s/* %s/cookbooks/' % (tmpfolder, os.path.normpath(chef.cookbooks), tmpfolder))
+ local('mkdir %s/cookbooks' % tmpfolder)
+
+ if not isinstance(chef.cookbooks, list):
+ chef.cookbooks = [chef.cookbooks]
+
+ for folder in chef.cookbooks:
+ local('cp -r %s/* %s/cookbooks/' % (os.path.normpath(folder), tmpfolder))
+
local('cd %s && tar -f cookbooks.tgz -cz ./cookbooks' % tmpfolder)
put('%s/cookbooks.tgz' % tmpfolder, chef.path, use_sudo=True)

0 comments on commit 21ea5fe

Please sign in to comment.