summaryrefslogtreecommitdiffstats
path: root/dashboard/src/booking/quick_deployer.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-01-30 13:40:15 -0500
committerParker Berberian <pberberian@iol.unh.edu>2019-02-12 13:40:30 -0500
commit0d596d5686c6348b12e091d94ef638d0bdb3eb0f (patch)
tree0b5ae08772b6a23bdd004931d6ca3de5df7b8e14 /dashboard/src/booking/quick_deployer.py
parent8ef0c2df68848f7c185ba226a3bc788c39297bb3 (diff)
Fixed all Flake8 errors
Change-Id: I1186429df8989461e2384f1f3e533c55cebfb1b4 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'dashboard/src/booking/quick_deployer.py')
-rw-r--r--dashboard/src/booking/quick_deployer.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/dashboard/src/booking/quick_deployer.py b/dashboard/src/booking/quick_deployer.py
index c431017..d838de9 100644
--- a/dashboard/src/booking/quick_deployer.py
+++ b/dashboard/src/booking/quick_deployer.py
@@ -124,7 +124,7 @@ def create_from_form(form, request):
raise InvalidHostnameException("Hostname must comply to RFC 952 and all extensions to it until this point")
# check that image os is compatible with installer
if installer in image.os.sup_installers.all():
- #if installer not here, we can omit that and not check for scenario
+ # if installer not here, we can omit that and not check for scenario
if not scenario:
raise IncompatibleScenarioForInstaller("An OPNFV Installer needs a scenario to be chosen to work properly")
if scenario not in installer.sup_scenarios.all():
@@ -137,9 +137,9 @@ def create_from_form(form, request):
raise ImageOwnershipInvalid("You are not the owner of the chosen private image")
# check if host type is available
- #ResourceManager.getInstance().acquireHost(ghost, lab.name)
+ # ResourceManager.getInstance().acquireHost(ghost, lab.name)
available_host_types = ResourceManager.getInstance().getAvailableHostTypes(lab)
- if not profile in available_host_types:
+ if profile not in available_host_types:
# TODO: handle deleting generic resource in this instance along with grb
raise HostNotAvailable("Could not book selected host due to changed availability. Try again later")
@@ -231,12 +231,8 @@ def create_from_form(form, request):
booking.pdf = ResourceManager().makePDF(booking.resource)
booking.config_bundle = cbundle
booking.save()
- print("users field:")
- print(users_field)
- print(type(users_field))
- #users_field = json.loads(users_field)
users_field = users_field[2:-2]
- if users_field: #may be empty after split, if no collaborators entered
+ if users_field: # may be empty after split, if no collaborators entered
users_field = json.loads(users_field)
for collaborator in users_field:
user = User.objects.get(id=collaborator['id'])