Issue #7639 has been updated by Sean Millichamp.

Status changed from Accepted to In Topic Branch Pending Review
Keywords set to schedule
Branch set to https://github.com/puppetlabs/puppet/pull/655

There were two different issues:

- Ranges spanning days weren't properly prevented.  This is no longer an issue 
as day-spanning range code was just merged in #13054

- Time ranges that weren't fully specified took the missing values from 
Time.now() instead of assuming zero, which is what most people would likely 
expect when discussing time ranges.  I have worked up a patch to switch that 
behavior to using zero instead in pull request 
[655](https://github.com/puppetlabs/puppet/pull/655).

----------------------------------------
Bug #7639: Schedule resource accepts invalid schedules
https://projects.puppetlabs.com/issues/7639#change-60342

Author: Josh Cooper
Status: In Topic Branch Pending Review
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: schedule
Branch: https://github.com/puppetlabs/puppet/pull/655


There are some problems with the schedule resource in how it parses and applies 
ranges:

* Resources may span days, even though the code attempts to prevent this.

  The code ensures that the lower limit hour is less than the upper limit hour, 
but does not check the minutes and seconds. As a result, a schedule of the form:
  <pre>
 schedule {
   maint: range => "1:2:3 - 1:0:0"
 }
  </pre>
  will result in an upper limit of 1AM tomorrow. In other words, we are 
spanning days, even though the code tries to prevent it.

* If minutes or seconds are omitted, they default to Time.now's minutes and 
seconds. 

  If you specify a schedule range of the form: "1:59:59 - 1" and Time.now's 
minutes and/or seconds are less, the same behavior as above can result.  As an 
aside it seems more intuitive that we default minutes and seconds to 0, even 
though it wouldn't prevent this scenario.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to