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
Member

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
…Updating unit/test_module_names.py to include integration.scheduler.test_run_job.
@dwoz
dwoz approved these changes Sep 29, 2019
salt/utils/schedule.py Outdated Show resolved Hide resolved
Copy link
Contributor

dhiltonp left a comment

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

…:garethgreenaway/salt into 54741_run_job_fails_without_time_element
@dwoz dwoz merged commit 4ee1ff6 into saltstack:2019.2.1 Sep 30, 2019
3 of 24 checks passed
3 of 24 checks passed
ci/py2/amazon2 This commit is being built
Details
ci/py2/centos6 This commit is being built
Details
ci/py2/centos7 This commit is being built
Details
ci/py2/centos7/tcp This commit is being built
Details
ci/py2/debian8 This commit is being built
Details
ci/py2/debian9 This commit is being built
Details
ci/py2/fedora29 This commit is being built
Details
ci/py2/ubuntu1604 This commit is being built
Details
ci/py2/ubuntu1604/tcp This commit is being built
Details
ci/py2/ubuntu1804 This commit is being built
Details
ci/py2/windows2016 This commit is being built
Details
ci/py3/amazon2 This commit is being built
Details
ci/py3/centos7 This commit is being built
Details
ci/py3/centos7/tcp This commit is being built
Details
ci/py3/debian8 This commit is being built
Details
ci/py3/debian9 This commit is being built
Details
ci/py3/fedora29 This commit is being built
Details
ci/py3/ubuntu1604 This commit is being built
Details
ci/py3/ubuntu1604/tcp This commit is being built
Details
ci/py3/ubuntu1804 This commit is being built
Details
ci/py3/windows2016 This commit is being built
Details
WIP Ready for review
Details
ci/docs This commit looks good
Details
ci/lint This commit looks good
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.