From 77377d5e9362bd35a3b300df231e82ee974675e1 Mon Sep 17 00:00:00 2001 From: Parker Berberian Date: Thu, 19 Dec 2019 12:39:01 -0500 Subject: Comments and Documentation This change adds a ton of comments and documentation across all the code. Change-Id: Ifee0a2f534e8584f14b0f13af4dda8dc70eb7553 Signed-off-by: Parker Berberian --- src/workflow/models.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/workflow/models.py') 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 -- cgit 1.2.3-korg