File tree 3 files changed +11
-1
lines changed
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ Install packages using the new hotness in Python package management...[`pip`](ht
101
101
- interpreter: The Python interpreter to use. default is ` python2.6 `
102
102
- owner: The owner for the virtualenv
103
103
- group: The group owner of the file (string or id)
104
+ - options : Command line options (string)
104
105
105
106
# Example
106
107
@@ -119,6 +120,14 @@ Install packages using the new hotness in Python package management...[`pip`](ht
119
120
action :create
120
121
end
121
122
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
+
122
131
Usage
123
132
=====
124
133
Original file line number Diff line number Diff line change 25
25
action :create do
26
26
unless exists?
27
27
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
29
29
user new_resource . owner if new_resource . owner
30
30
group new_resource . group if new_resource . group
31
31
end
Original file line number Diff line number Diff line change 24
24
attribute :interpreter , :default => 'python2.6'
25
25
attribute :owner , :regex => Chef ::Config [ :user_valid_regex ]
26
26
attribute :group , :regex => Chef ::Config [ :group_valid_regex ]
27
+ attribute :options , :kind_of => String
You can’t perform that action at this time.
0 commit comments