Chef 12 ignores default_release for apt_package


#1

Hey!

I just figured out an issue after upgrading to chef 12. When specifying a default_release option for apt_package this option will be ignored.

Small example:
apt_package “haveged” do
default_release "wheezy-backports"
end

I would expect that chef install 1.9.1-1~bpo70+1, but it actually installs 1.4-4. Using chef 11.16 this works as expected and installs haveged from backports. Please have a look at the attachment for a small recipe that illustrates the issue.

Thanks!
Thomas

Sent with Unibox


#2

On Wednesday, December 10, 2014 at 7:16 AM, Thomas Preißler wrote:

Hey!

I just figured out an issue after upgrading to chef 12. When specifying a default_release option for apt_package this option will be ignored.

Small example:
apt_package “haveged” do
default_release "wheezy-backports"
end

I would expect that chef install 1.9.1-1~bpo70+1, but it actually installs 1.4-4. Using chef 11.16 this works as expected and installs haveged from backports. Please have a look at the attachment for a small recipe that illustrates the issue.

Thanks!
Thomas

Sent with Unibox (http://www.uniboxapp.com/t/sig)

Attachments:

  • test.rb

I looked at the diffs comparing Chef 12 to 11.16.4 for the apt_package resource and providers, and there aren’t any relevant changes. Unfortunately, GitHub doesn’t let you do a “focused” comparison view, but if you run these commands from a git checkout, you will see the code is unchanged:

git diff 11.16.4 – lib/chef/resource/apt_package.rb
git diff 11.16.4 – lib/chef/provider/package.rb

git diff 11.16.4 – lib/chef/provider/package/apt.rb

Are you running your tests against identical clean VMs?

Of course, it’s possible there’s some code path I didn’t consider that is causing this problem, if you don’t find any other cause of this behavior, please file a bug on GitHub and we’ll take another look.


Daniel DeLeo


#3

Hey Daniel,

thanks for getting back!

Are you running your tests against identical clean VMs?
Yes, I do. I set up two clean VMs, installed Chef 11.16.4 on the first one and 12.0.1 on the second. After executing the example recipe of my last message I get haveged 1.9.1-1~bpo70+1 on the first VM and 1.4-4 on the second. The only difference between these two machines is the chef version.

Of course, it’s possible there’s some code path I didn’t consider that is causing this problem, if you don’t find any other cause of this behavior, please file a bug on GitHub and we’ll take another look.
Thanks for looking into this. I posted an issue on Github right now: https://github.com/opscode/chef/issues/2606

Thomas