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

Fix to scheduler when job without a time element is run with schedule.run_job #54799

Conversation

garethgreenaway
Copy link
Contributor

@garethgreenaway garethgreenaway commented Sep 28, 2019

What does this PR do?

If a scheduled job does not contains a time element parameter, running that job with schedule.run_job fails and causes a traceback because data['run'] does not exist.

What issues does this PR fix or reference?

#54741

Previous Behavior

Jobs without time elements when run with "schedule.run_job" failed with traceback.

New Behavior

Ensure data['run'] exists and handle situations when it does not. Jobs run as expected.

Tests written?

[NOTICE] Bug fixes or features added to Salt require tests.
Please review the test documentation for details on how to implement tests into Salt's test suite.
Yes

Commits signed with GPG?

Yes

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

…nning that job with schedule.run_job fails with a traceback because data['run'] does not exist.
@garethgreenaway garethgreenaway changed the title Fix to scheduler when job has no time element and run with schedule.run_job Fix to scheduler when job without a time element is run with schedule.run_job Sep 28, 2019
salt/utils/schedule.py Outdated Show resolved Hide resolved
Copy link
Contributor

@dhiltonp dhiltonp left a comment

Choose a reason for hiding this comment

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

There's a tiny bit of duplication, maybe we can clean it up?

@dwoz dwoz merged commit 4ee1ff6 into saltstack:2019.2.1 Sep 30, 2019
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.

4 participants