aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/workflow/models.py')
-rw-r--r--src/workflow/models.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/workflow/models.py b/src/workflow/models.py
index 99608f6..32ac39c 100644
--- a/src/workflow/models.py
+++ b/src/workflow/models.py
@@ -26,6 +26,15 @@ from booking.models import Booking
class BookingAuthManager():
+ """
+ Verifies Booking Authorization.
+
+ Class to verify that the user is allowed to book the requested resource
+ The user must input a url to the INFO.yaml file to prove that they are the ptl of
+ an approved project if they are booking a multi-node pod.
+ This class parses the url and checks the logged in user against the info file.
+ """
+
LFN_PROJECTS = ["opnfv"] # TODO
def parse_github_url(self, url):
@@ -124,7 +133,9 @@ class BookingAuthManager():
def parse_url(self, info_url):
"""
- will return the PTL in the INFO file on success, or None
+ Parse the project URL.
+
+ Gets the INFO.yaml file from the project and returns the PTL info.
"""
if "github" in info_url:
return self.parse_github_url(info_url)
@@ -137,6 +148,8 @@ class BookingAuthManager():
def booking_allowed(self, booking, repo):
"""
+ Assert the current Booking Policy.
+
This is the method that will have to change whenever the booking policy changes in the Infra
group / LFN. This is a nice isolation of that administration crap
currently checks if the booking uses multiple servers. if it does, then the owner must be a PTL,
@@ -158,6 +171,14 @@ class BookingAuthManager():
class WorkflowStepStatus(object):
+ """
+ Poor man's enum for the status of a workflow step.
+
+ The steps in a workflow are not completed (UNTOUCHED)
+ or they have been completed correctly (VALID) or they were filled out
+ incorrectly (INVALID)
+ """
+
UNTOUCHED = 0
INVALID = 100
VALID = 200