Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d05c7c

Browse files
author
Joshua Timberman
committed
Merge pull request poise#10 from rody/COOK-1311
[COOK-1311] Added 'options' for virtualenv command.
2 parents 210a502 + 5c8019a commit 2d05c7c

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Install packages using the new hotness in Python package management...[`pip`](ht
101101
- interpreter: The Python interpreter to use. default is `python2.6`
102102
- owner: The owner for the virtualenv
103103
- group: The group owner of the file (string or id)
104+
- options : Command line options (string)
104105

105106
# Example
106107

@@ -119,6 +120,14 @@ Install packages using the new hotness in Python package management...[`pip`](ht
119120
action :create
120121
end
121122

123+
# create a Python 2.6 virtualenv with access to the global packages owned by ubuntu user
124+
python_virtualenv "/home/ubuntu/my_old_ve" do
125+
owner "ubuntu"
126+
group "ubuntu"
127+
options "--system-site-packages"
128+
action :create
129+
end
130+
122131
Usage
123132
=====
124133

providers/virtualenv.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
action :create do
2626
unless exists?
2727
Chef::Log.info("Creating virtualenv #{@new_resource} at #{@new_resource.path}")
28-
execute "#{virtualenv_cmd} --python=#{@new_resource.interpreter} #{@new_resource.path}" do
28+
execute "#{virtualenv_cmd} --python=#{@new_resource.interpreter} #{@new_resource.options} #{@new_resource.path}" do
2929
user new_resource.owner if new_resource.owner
3030
group new_resource.group if new_resource.group
3131
end

resources/virtualenv.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@
2424
attribute :interpreter, :default => 'python2.6'
2525
attribute :owner, :regex => Chef::Config[:user_valid_regex]
2626
attribute :group, :regex => Chef::Config[:group_valid_regex]
27+
attribute :options, :kind_of => String

0 commit comments

Comments
 (0)