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

Skip to content
This repository was archived by the owner on Apr 26, 2019. It is now read-only.

Commit d565498

Browse files
committed
Added 'options' for virtualenv command.
Sometimes it is desirable to pass command line options to virtualenv (such as --system-site-packages), so I added an 'options' to the virtualenv resources (the same way as the pip command)
1 parent bb17707 commit d565498

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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)