aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow/models.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-12-19 12:39:01 -0500
committerParker Berberian <pberberian@iol.unh.edu>2020-01-28 16:09:35 -0500
commit77377d5e9362bd35a3b300df231e82ee974675e1 (patch)
tree5e3799768eb887a0259c8c21ed61123cdde2d608 /src/workflow/models.py
parent899e1a4baa95d0bc6f0eef34de66f0e257174878 (diff)
Comments and Documentation
This change adds a ton of comments and documentation across all the code. Change-Id: Ifee0a2f534e8584f14b0f13af4dda8dc70eb7553 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
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