Permalink
Browse files

Merge pull request #10 from rody/COOK-1311

[COOK-1311] Added 'options' for virtualenv command.
  • Loading branch information...
2 parents 210a502 + 5c8019a commit 2d05c7c75a4ca48ae4b2261a1bc3f2dd9aaa9ac2 @jtimberman jtimberman committed Jun 14, 2012
Showing with 11 additions and 1 deletion.
  1. +9 −0 README.md
  2. +1 −1 providers/virtualenv.rb
  3. +1 −0 resources/virtualenv.rb
View
@@ -101,6 +101,7 @@ Install packages using the new hotness in Python package management...[`pip`](ht
- interpreter: The Python interpreter to use. default is `python2.6`
- owner: The owner for the virtualenv
- group: The group owner of the file (string or id)
+- options : Command line options (string)
# Example
@@ -119,6 +120,14 @@ Install packages using the new hotness in Python package management...[`pip`](ht
action :create
end
+ # create a Python 2.6 virtualenv with access to the global packages owned by ubuntu user
+ python_virtualenv "/home/ubuntu/my_old_ve" do
+ owner "ubuntu"
+ group "ubuntu"
+ options "--system-site-packages"
+ action :create
+ end
+
Usage
=====
View
@@ -25,7 +25,7 @@
action :create do
unless exists?
Chef::Log.info("Creating virtualenv #{@new_resource} at #{@new_resource.path}")
- execute "#{virtualenv_cmd} --python=#{@new_resource.interpreter} #{@new_resource.path}" do
+ execute "#{virtualenv_cmd} --python=#{@new_resource.interpreter} #{@new_resource.options} #{@new_resource.path}" do
user new_resource.owner if new_resource.owner
group new_resource.group if new_resource.group
end
View
@@ -24,3 +24,4 @@
attribute :interpreter, :default => 'python2.6'
attribute :owner, :regex => Chef::Config[:user_valid_regex]
attribute :group, :regex => Chef::Config[:group_valid_regex]
+attribute :options, :kind_of => String

0 comments on commit 2d05c7c

Please sign in to comment.