Updating various docstrings

This commit is contained in:
Gareth J. Greenaway 2017-12-04 14:35:26 -08:00
parent 77c89afbb8
commit eec7393b0c
No known key found for this signature in database
GPG Key ID: 10B62F8A7CAD7A41
2 changed files with 8 additions and 7 deletions

View File

@ -818,12 +818,13 @@ class Schedule(object):
def get_next_fire_time(self, name):
'''
Disable a job in the scheduler. Ignores jobs from pillar
Return the next fire time for the specified job
'''
schedule = self._get_schedule()
_next_fire_time = None
if schedule:
_next_fire_time = schedule[name]['_next_fire_time']
_next_fire_time = schedule.get(name, {}).get('_next_fire_time', None)
# Fire the complete event back along with updated list of schedule
evt = salt.utils.event.get_event('minion', opts=self.opts, listen=False)
@ -832,11 +833,11 @@ class Schedule(object):
def job_status(self, name):
'''
Disable a job in the scheduler. Ignores jobs from pillar
Return the specified schedule item
'''
schedule = self._get_schedule()
return schedule[name]
return schedule.get(name, {})
def handle_func(self, multiprocessing_enabled, func, data):
'''

View File

@ -77,7 +77,7 @@ class SchedulerTest(ModuleCase, SaltReturnAssertsMixin):
def test_skip(self):
'''
verify that scheduled job runs
verify that scheduled job is skipped at the specified time
'''
job = {
'schedule': {
@ -107,7 +107,7 @@ class SchedulerTest(ModuleCase, SaltReturnAssertsMixin):
def test_postpone(self):
'''
verify that scheduled job runs
verify that scheduled job is postponed until the specified time.
'''
job = {
'schedule': {
@ -148,7 +148,7 @@ class SchedulerTest(ModuleCase, SaltReturnAssertsMixin):
def test_skip_during_range(self):
'''
verify that scheduled job runs
verify that scheduled job is skipped during the specified range
'''
job = {
'schedule': {