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

Allow other time units in notification and scheduleddowntime #220

Merged
merged 1 commit into from
Feb 21, 2017

Conversation

jkroepke
Copy link
Contributor

Hi,

while i'm moving from the old puppet to the new, I have notice that values like 30m are not allowed anymore in some parameters.

Here is a PR for 2 cases, maybe there are a lot of more...

Copy link
Contributor

@lazyfrosch lazyfrosch left a comment

Choose a reason for hiding this comment

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

Please update the Regexp, but thanks for noticing 👍

@@ -123,7 +123,7 @@
if !is_string($user_groups) { validate_array($user_groups) }
if $times { validate_hash ($times )}
if $command { validate_string ($command )}
if $interval { validate_integer ($interval )}
if $interval { validate_re($interval, '^\d+\.?\d*[d|h|m|s]?$')}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use: \d+(\.\d+)?[dhms]?

Your syntax is not really correct, its either (d|h|m|s) or [dhms]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -88,7 +88,7 @@
if $author { validate_string($author) }
if $comment { validate_string($comment) }
if $fixed { validate_bool($fixed) }
if $duration { validate_integer($duration) }
if $duration { validate_re($duration, '^\d+\.?\d*[d|h|m|s]?$') }
Copy link
Contributor

Choose a reason for hiding this comment

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

change the regexp here too

@jkroepke jkroepke force-pushed the dependency_duration branch from 1dbe9c3 to 27ca964 Compare January 28, 2017 12:52
@lazyfrosch
Copy link
Contributor

I guess we should update that everywhere.

Want to do it? Would you have a look on the failing tests, or should we?

@jkroepke
Copy link
Contributor Author

jkroepke commented Jan 28, 2017

Want to do it? Would you have a look on the failing tests, or should we?

Can I look into it.

@jkroepke
Copy link
Contributor Author

@lazyfrosch

All breakage relevant tests failed, because the error message has changed. I wound why there are test for breakage since you comment long time okay that is usually or unnecessary.

Icinga/puppet-icinga2-legacy#169 (comment)

@lazyfrosch
Copy link
Contributor

Noticed that myself while activating travis tests. Will discuss that this week with the guys.

Had similar problems with expecting for string behavior between Puppet 3+4.

Could you update the tests so:

  • it tests for numeric and with suffix
  • does not try to raise and test for exceptions for that params

Appreciate your help here ;)

@jkroepke jkroepke force-pushed the dependency_duration branch from 27ca964 to 29ed275 Compare January 28, 2017 13:10
@bobapple
Copy link
Contributor

Hi @jkroepke
thanks for the effort. We should should rather change the tests where the error message has changed instead of removing them. I don't think these tests are unnecessary, they help us when editing the format of a parameter, like in this case here. I would ask you to please just change the error messages where necessary.

Please let me know if you will look into other objects, if they need this kind of updates. I just want to have a plan how we will proceed with this.

@bobapple bobapple merged commit 29ed275 into voxpupuli:master Feb 21, 2017
@bobapple
Copy link
Contributor

I fixed the specs and merged into master

@bobapple bobapple added this to the v1.1.0 milestone Mar 13, 2017
@jkroepke jkroepke deleted the dependency_duration branch March 26, 2017 19:55
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 this pull request may close these issues.

3 participants