-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converts tasking system to use Django models
Moves all tasking code to pulp.platform.tasks and updates existing usage to use the new location. Also the code itself is converted to use the new Django models. https://pulp.plan.io/issues/2154 closes #2154
- Loading branch information
Brian Bouterse
committed
Oct 3, 2016
1 parent
236a0e4
commit aba8ba2
Showing
72 changed files
with
1,062 additions
and
1,311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .constants import TASK_FINAL_STATES, TASK_INCOMPLETE_STATES, TASK_STATES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from types import SimpleNamespace | ||
|
||
|
||
TASK_STATES = SimpleNamespace( | ||
WAITING='waiting', | ||
SKIPPED='skipped', | ||
RUNNING='running', | ||
COMPLETED='completed', | ||
FAILED='failed', | ||
CANCELED='canceled' | ||
) | ||
|
||
TASK_FINAL_STATES = (TASK_STATES.SKIPPED, TASK_STATES.COMPLETED, TASK_STATES.FAILED, | ||
TASK_STATES.CANCELED) | ||
TASK_INCOMPLETE_STATES = (TASK_STATES.WAITING, TASK_STATES.RUNNING) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from collections import namedtuple | ||
from gettext import gettext as _ | ||
|
||
|
||
Error = namedtuple('Error', ['code', 'message', 'required_fields']) | ||
""" | ||
The error named tuple has 3 components: | ||
code: The 7 character uniquely identifying code for this error, 3 A-Z identifying the module | ||
followed by 4 numeric characters for the msg id. All general pulp server errors start | ||
with PLP | ||
message: The message that will be printed for this error | ||
required_files: A list of required fields for printing the message | ||
""" | ||
|
||
# The PLP0000 error is to wrap non-pulp exceptions | ||
PLP0000 = Error("PLP0000", "%(message)s", ['message']) | ||
PLP0001 = Error("PLP0001", _("A general pulp exception occurred"), []) | ||
PLP0008 = Error("PLP0008", _("Error raising error %(code)s. " | ||
"The field [%(field)s] was not included in the error_data."), | ||
['code', 'field']) | ||
PLP0009 = Error("PLP0009", _("Missing resource(s): %(resources)s"), ['resources']) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .base import PulpCodedException, PulpException | ||
from .http import MissingResource |
Oops, something went wrong.