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

backports: Allow setting a custom priority. #275

Merged
merged 1 commit into from
Mar 26, 2014
Merged

backports: Allow setting a custom priority. #275

merged 1 commit into from
Mar 26, 2014

Conversation

daenney
Copy link

@daenney daenney commented Mar 26, 2014

The module used to always pin backports to a priority of 200. This
default is still retained but is now configurable.

Additionally the default is now an Integer, not a 'quoted Integer' and
the tests have been updated to reflect this. This matters for future
parser as it will now kick people if they pass in a stringified integer
as priority.

) inherits apt::params {

if ! is_integer($pin_priority) {
fail('$pin_priority must be an integer')
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause anyone who has ever quoted their pin values to have failures.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it won't:

$var = '1'
class test{
  if ! is_integer($var) {
    fail()
  } else {
    notice('stringified ints still ints')
  }
}

include ::test

Result:

Notice: Scope(Class[Test]): stringified ints still ints

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh puppet... :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the future parser do with that code?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

future parser will complain because a string is a string there. As far as I'm concerned that's only good. Future parser is stricter about types and this really should be an integer, apt also treats it as such.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The is_integer actually passes with future parser because that's how that function is coded, it accepts strings that represent integers. It will break when you try to pass in a string to $pin_priority though because the default param is of type int.

@daenney
Copy link
Author

daenney commented Mar 26, 2014

Could you restart the build please? Travis is throwing gem install errors.

@hunner
Copy link

hunner commented Mar 26, 2014

You'll have to rebase now that #276 has been merged for travis to pass.

The module used to always pin backports to a priority of 200. This
default is still retained but is now configurable.

Additionally the default is now an Integer, not a 'quoted Integer' and
the tests have been updated to reflect this. This matters for future
parser as it will now kick people if they pass in a stringified integer
as priority.
@daenney
Copy link
Author

daenney commented Mar 26, 2014

@hunner: Done.

hunner added a commit that referenced this pull request Mar 26, 2014
backports: Allow setting a custom priority.
@hunner hunner merged commit 9ebbeae into puppetlabs:master Mar 26, 2014
@daenney daenney deleted the backports-pin-priority branch March 27, 2014 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants