X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/18e12b0e123fc3e5f344682f884feabc12da0f5a..c6902ea9afba17351101f28b4a401e5193b89c1b:/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