aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow/workflow_manager.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2018-11-20 11:19:55 -0500
committerParker Berberian <pberberian@iol.unh.edu>2018-11-26 14:07:15 -0500
commitb7c4d286ffa618be0e95b15f3883e2f6920a3fb1 (patch)
tree930e9b9282b8f50e671844b2a1e7f39dc5d6035d /src/workflow/workflow_manager.py
parent6a90796de1df8d74c79415c39c867ffe6cd80fd0 (diff)
Fix all flake8 errors
The flake8 command in test.sh finds no longer finds any errors. This may form a basis of a jenkins verify job as a sort of 'weak compile-time checks' The flake8 command will not complain about line length, and will not complain about django's manage.py file Change-Id: Ic47cb4fc7ada55e64485661ab6881aef475018ff Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'src/workflow/workflow_manager.py')
-rw-r--r--src/workflow/workflow_manager.py26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/workflow/workflow_manager.py b/src/workflow/workflow_manager.py
index 16fa468..95fefbf 100644
--- a/src/workflow/workflow_manager.py
+++ b/src/workflow/workflow_manager.py
@@ -8,23 +8,24 @@
##############################################################################
-from django.db import models
-from django.contrib.auth.models import User
-from django.core import serializers
-from django.http import HttpResponse, JsonResponse
+from django.http import JsonResponse
-import json
-import uuid
import random
-from resource_inventory.models import *
from booking.models import Booking
from workflow.workflow_factory import WorkflowFactory, MetaStep, MetaRelation
from workflow.models import Repository, Confirmation_Step
+from resource_inventory.models import (
+ GenericResourceBundle,
+ ConfigBundle,
+ HostConfiguration,
+ OPNFVConfig
+)
import logging
logger = logging.getLogger(__name__)
+
class SessionManager():
def __init__(self, request=None):
@@ -38,7 +39,7 @@ class SessionManager():
metaconfirm = MetaStep()
metaconfirm.index = 0
metaconfirm.short_title = "confirm"
- self.repository.el['steps'] = 1;
+ self.repository.el['steps'] = 1
self.metaworkflow = None
self.metaworkflows = []
self.metarelations = []
@@ -85,10 +86,8 @@ class SessionManager():
self.metarelations.append(relation)
self.initialized = True
-
def status(self, request):
try:
- workflows = []
steps = []
for step in self.step_meta:
steps.append(step.to_json())
@@ -109,11 +108,11 @@ class SessionManager():
responsejson['parents'] = parents
responsejson['children'] = children
return JsonResponse(responsejson, safe=False)
- except Exception as e:
+ except Exception:
pass
def render(self, request, **kwargs):
- #filter out when a step needs to handle post/form data
+ # filter out when a step needs to handle post/form data
# if 'workflow' in post data, this post request was meant for me, not step
if request.method == 'POST' and request.POST.get('workflow', None) is None:
return self.steps[self.active_index].post_render(request)
@@ -125,7 +124,7 @@ class SessionManager():
def goto(self, num, **kwargs):
self.repository.el['active_step'] = int(num)
self.active_index = int(num)
- #TODO: change to include some checking
+ # TODO: change to include some checking
def prefill_repo(self, target_id, workflow_type):
self.repository.el[self.repository.EDIT] = True
@@ -140,7 +139,6 @@ class SessionManager():
edit_object = ConfigBundle.objects.get(pk=target_id)
self.prefill_config(edit_object)
-
def prefill_booking(self, booking):
models = self.make_booking_models(booking)
confirmation = self.make_booking_confirm(booking)