Closed mcka1n closed 1 year ago
Reproducing the bug:
include apt
apt::pin { 'test2':
release => 'buster',
}
Produces:
cat /etc/apt/preferences.d/test2.pref
# This file is managed by Puppet. DO NOT EDIT.
Explanation: : test2
Package: *
Pin: release a=buster, n=, v=, c=, o=, l=
Pin-Priority: 0
With my patch the result will be the following:
cat /etc/apt/preferences.d/test2.pref
# This file is managed by Puppet. DO NOT EDIT.
Explanation: : test2
Package: *
Pin: release a=buster
Pin-Priority: 0
Describe the Bug
Martin Alfke (@tuxmea) found a bug and reached out to us at the Conf Management Conference.
The issue is that this line breaks:
https://github.com/puppetlabs/puppetlabs-apt/blob/main/templates/pin.pref.epp#L6
https://github.com/puppetlabs/puppetlabs-apt/blob/main/manifests/pin.pp#L51
Because the variable changed to undef and the validation.
Expected Behavior
The validation doesn't break
Steps to Reproduce
Steps to reproduce the behavior:
https://github.com/puppetlabs/puppetlabs-apt/blob/main/manifests/pin.pp#L51
Environment
Additional Context
Martin might add more context about this bug
@tuxmea