lib/chef/provider/package/easy_install.rb in chef-0.8.16 vs lib/chef/provider/package/easy_install.rb in chef-0.9.0.a3

- old
+ new

@@ -46,17 +46,17 @@ @current_resource = Chef::Resource::Package.new(@new_resource.name) @current_resource.package_name(@new_resource.package_name) @current_resource.version(nil) # get the currently installed version if installed + package_version = nil if install_check(@new_resource.package_name) command = "python -c \"import #{@new_resource.package_name}; print #{@new_resource.package_name}.__path__\"" - pid, stdin, stdout, stderr = popen4(command) - install_location = stdout.readline - install_location[/\S\S(.*)\/(.*)-(.*)-py(.*).egg\S/] - package_version = $3 - else - package_version = nil + status = popen4(command) do |pid, stdin, stdout, stderr| + install_location = stdout.readline + install_location[/\S\S(.*)\/(.*)-(.*)-py(.*).egg\S/] + package_version = $3 + end end if package_version == @new_resource.version Chef::Log.debug("#{@new_resource.package_name} at version #{@new_resource.version}") @current_resource.version(@new_resource.version)