-
Notifications
You must be signed in to change notification settings - Fork 459
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
Conversation
| ) inherits apt::params { | ||
|
|
||
| if ! is_integer($pin_priority) { | ||
| fail('$pin_priority must be an integer') | ||
| } |
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.
This will cause anyone who has ever quoted their pin values to have failures.
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.
No it won't:
$var = '1'
class test{
if ! is_integer($var) {
fail()
} else {
notice('stringified ints still ints')
}
}
include ::testResult:
Notice: Scope(Class[Test]): stringified ints still ints
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.
Oh puppet... :)
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.
What does the future parser do with that code?
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.
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.
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.
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.
|
Could you restart the build please? Travis is throwing gem install errors. |
|
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.
|
@hunner: Done. |
backports: Allow setting a custom priority.
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.