Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9c79a8

Browse files
author
Joshua Timberman
committed
Merge pull request poise#45 from e100/fix_pip_name
Allow name and package_name to be different to avoid CHEF-3694 warnings
2 parents cd033e5 + 6519292 commit b9c79a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

providers/pip.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def candidate_version
131131
def install_package(version)
132132
# if a version isn't specified (latest), is a source archive (ex. http://my.package.repo/SomePackage-1.0.4.zip),
133133
# or from a VCS (ex. git+https://git.repo/some_pkg.git) then do not append a version as this will break the source link
134-
if version == 'latest' || new_resource.name.downcase.start_with?('http:', 'https:') || ['git', 'hg', 'svn'].include?(new_resource.name.downcase.split('+')[0])
134+
if version == 'latest' || new_resource.package_name.downcase.start_with?('http:', 'https:') || ['git', 'hg', 'svn'].include?(new_resource.package_name.downcase.split('+')[0])
135135
version = ''
136136
else
137137
version = "==#{version}"
@@ -152,7 +152,7 @@ def remove_package(version)
152152
def pip_cmd(subcommand, version='')
153153
options = { :timeout => new_resource.timeout, :user => new_resource.user, :group => new_resource.group }
154154
options[:environment] = { 'HOME' => ::File.expand_path("~#{new_resource.user}") } if new_resource.user
155-
shell_out!("#{which_pip(new_resource)} #{subcommand} #{new_resource.options} #{new_resource.name}#{version}", options)
155+
shell_out!("#{which_pip(new_resource)} #{subcommand} #{new_resource.options} #{new_resource.package_name}#{version}", options)
156156
end
157157

158158
# TODO remove when provider is moved into Chef core

0 commit comments

Comments
 (0)