Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

… get collapsed into a single one before uploading
  • Loading branch information...
commit 21ea5fe1606b5fc459ccc53a68b3eb3efacedf5c 1 parent 875330f
Alen Mujezinovic authored December 01, 2011

Showing 1 changed file with 10 additions and 3 deletions. Show diff stats Hide diff stats

  1. 13  provision/__init__.py
13  provision/__init__.py
@@ -7,11 +7,11 @@
7 7
 import sys
8 8
 import tempfile
9 9
 
10  
-__version__ = '0.0.2'
  10
+__version__ = '0.0.3'
11 11
 
12 12
 DEFAULTS = dict(
13 13
     path='/var/chef',
14  
-    cookbooks='cookbooks',
  14
+    cookbooks=['cookbooks'],
15 15
     log_level='info',
16 16
     gems='1.8.10',
17 17
     recipes=[],
@@ -79,7 +79,14 @@ def upload():
79 79
     
80 80
     tmpfolder = tempfile.mkdtemp()
81 81
     
82  
-    local('mkdir %s/cookbooks && cp -r %s/* %s/cookbooks/' % (tmpfolder, os.path.normpath(chef.cookbooks), tmpfolder))
  82
+    local('mkdir %s/cookbooks' % tmpfolder)
  83
+
  84
+    if not isinstance(chef.cookbooks, list):
  85
+        chef.cookbooks = [chef.cookbooks]
  86
+    
  87
+    for folder in chef.cookbooks:
  88
+        local('cp -r %s/* %s/cookbooks/' % (os.path.normpath(folder), tmpfolder))
  89
+        
83 90
     local('cd %s && tar -f cookbooks.tgz -cz ./cookbooks' % tmpfolder)
84 91
     
85 92
     put('%s/cookbooks.tgz' % tmpfolder, chef.path, use_sudo=True)

0 notes on commit 21ea5fe

Please sign in to comment.
Something went wrong with that request. Please try again.