Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked frompoise/python

Commit2d05c7c

Browse files
author
Joshua Timberman
committed
Merge pull requestpoise#10 from rody/COOK-1311
[COOK-1311] Added 'options' for virtualenv command.
2 parents210a502 +5c8019a commit2d05c7c

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:createdo
2626
unlessexists?
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
usernew_resource.ownerifnew_resource.owner
3030
groupnew_resource.groupifnew_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)

[8]ページ先頭

©2009-2025 Movatter.jp