-
Notifications
You must be signed in to change notification settings - Fork 462
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
Remove .length from variable $pin_release in app #754
Conversation
This causes Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Unknown function: 'length'. at /etc/puppet/environments/production/modules/apt/templates/pin.pref.epp:4:16 at /etc/puppet/environments/production/modules/apt/manifests/source.pp:92 on node xxx downstream
We use puppet 4.8 from stretch. |
closing, and re-openning to force travis to re-kick |
templates/pin.pref.epp
Outdated
@@ -1,7 +1,7 @@ | |||
<%- | $name, $pin_release, $release, $codename, $release_version, $component, $originator, $label, $version, $origin, $explanation, $packages_string, $priority | -%> | |||
<%- | |||
$pin = | |||
if $pin_release.length > 0 { | |||
if $pin_release { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this be better
if $pin_release and $pin_release.length > 0
Following the logic of the rest of the template.
Many thanks for the code !!! @paladox
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, done.
Causes Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, epp(): Invalid EPP: Syntax error at 'options' at /etc/puppet/environments/production/modules/apt/templates/pin.pref.epp:5:3 at /etc/puppet/environments/production/modules/apt/manifests/pin.pp:74:17 at /etc/puppet/environments/production/modules/redis/manifests/init.pp:9 on node misc2.miraheze.org |
and now i get Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Unknown function: 'length'. at /etc/puppet/environments/production/modules/apt/templates/pin.pref.epp:4:33 at /etc/puppet/environments/production/modules/redis/manifests/init.pp:9 on node misc2.miraheze.org again |
thanks @paladox i will have another look, and get back to you. |
apologies, for the interruption again, what manifest/data where you using to test this ? |
or revert back to what you had, and i will merge. |
@tphoney we have this:
/~https://github.com/miraheze/puppet/blob/master/modules/redis/manifests/init.pp#L9 /~https://github.com/miraheze/puppet/blob/master/manifests/site.pp#L42 |
doing
should also work? I think .length will only work on a array? |
https://forge.puppet.com/puppetlabs/stdlib#length Its a weird one :) depends on the puppet version 4 vs 5. I think, revert to 'if $pin_release ' and i will merge. the same goes for empty |
templates/pin.pref.epp
Outdated
@@ -1,14 +1,14 @@ | |||
<%- | $name, $pin_release, $release, $codename, $release_version, $component, $originator, $label, $version, $origin, $explanation, $packages_string, $priority | -%> | |||
<%- | |||
$pin = | |||
if $pin_release.length > 0 { | |||
if $pin_release { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be != ''?
This looks good™️ 👍. Thanks for the effort you have put in. |
your welcome and thanks for merging! :) |
This causes
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Unknown function: 'length'. at /etc/puppet/environments/production/modules/apt/templates/pin.pref.epp:4:16 at /etc/puppet/environments/production/modules/apt/manifests/source.pp:92 on node xxx
downstream
We use puppet from Debian stretch