Skip to content

Commit

Permalink
Merge pull request poise#10 from rody/COOK-1311
Browse files Browse the repository at this point in the history
[COOK-1311] Added 'options' for virtualenv command.
  • Loading branch information
Joshua Timberman committed Jun 14, 2012
2 parents 210a502 + 5c8019a commit 2d05c7c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
=====

Expand Down
2 changes: 1 addition & 1 deletion providers/virtualenv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions resources/virtualenv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.