X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/1269b473221f4b6c5f7beee400092c9620fc79fb..24ff6e33b025aedeea2db4655bec734089731b8e:/cookbooks/python/resources/package.rb?ds=sidebyside diff --git a/cookbooks/python/resources/package.rb b/cookbooks/python/resources/package.rb index 4a3cb9f01..fb9cf09bd 100644 --- a/cookbooks/python/resources/package.rb +++ b/cookbooks/python/resources/package.rb @@ -22,6 +22,7 @@ default_action :install property :package_name, :kind_of => String, :name_property => true property :version, :kind_of => String property :python_version, :kind_of => String +property :python_virtualenv, :kind_of => String action :install do if new_resource.version.nil? @@ -46,6 +47,10 @@ end action_class do def pip_command - "pip#{new_resource.python_version}" + if new_resource.python_virtualenv + "#{new_resource.python_virtualenv}/bin/pip" + else + "pip#{new_resource.python_version}" + end end end