This repository was archived by the owner on Oct 2, 2018. It is now read-only.
Commit 6be1a46 1 parent 4920ddd commit 6be1a46 Copy full SHA for 6be1a46
File tree 2 files changed +5
-1
lines changed
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,10 @@ def remove_package(version)
151
151
152
152
def pip_cmd ( subcommand , version = '' )
153
153
options = { :timeout => new_resource . timeout , :user => new_resource . user , :group => new_resource . group }
154
- options [ :environment ] = { 'HOME' => ::File . expand_path ( "~#{ new_resource . user } " ) } if new_resource . user
154
+ environment = Hash . new
155
+ environment . merge! ( { 'HOME' => ::File . expand_path ( "~#{ new_resource . user } " ) } ) if new_resource . user
156
+ environment . merge! ( new_resource . environment ) if new_resource . environment
157
+ options [ :environment ] = environment
155
158
shell_out! ( "#{ which_pip ( new_resource ) } #{ subcommand } #{ new_resource . options } #{ new_resource . package_name } #{ version } " , options )
156
159
end
157
160
Original file line number Diff line number Diff line change @@ -34,3 +34,4 @@ def initialize(*args)
34
34
attribute :user , :regex => Chef ::Config [ :user_valid_regex ]
35
35
attribute :group , :regex => Chef ::Config [ :group_valid_regex ]
36
36
attribute :options , :kind_of => String , :default => ''
37
+ attribute :environment , :kind_of => Hash , :default => { }
You can’t perform that action at this time.
0 commit comments