Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables ($release) that are defined as undef are breaking with '' validation #1089

Closed
mcka1n opened this issue Feb 7, 2023 · 1 comment · Fixed by #1090
Closed

Variables ($release) that are defined as undef are breaking with '' validation #1089

mcka1n opened this issue Feb 7, 2023 · 1 comment · Fixed by #1090

Comments

@mcka1n
Copy link

mcka1n commented Feb 7, 2023

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:

  1. Use the apt module, and try to call any of the Strings defined in the module

https://github.com/puppetlabs/puppetlabs-apt/blob/main/manifests/pin.pp#L51

image

  1. Click on '....'

Environment

Additional Context

Martin might add more context about this bug

@tuxmea

tuxmea added a commit to tuxmea/puppetlabs-apt that referenced this issue Feb 8, 2023
the apt::pin define has switched from empty string to Undef.
But the template was not updated.

fixes puppetlabs#1089
@tuxmea
Copy link

tuxmea commented Feb 8, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants