summaryrefslogtreecommitdiffstats
path: root/django/validationmanager
diff options
context:
space:
mode:
authorAlmog Laktivi <al942u@att.com>2017-11-21 10:44:49 +0200
committerAlmog Laktivi <al942u@att.com>2017-11-21 10:45:06 +0200
commit97fc837a29af8757a036eed513b95833f1cdab24 (patch)
tree37f1387a3fa169c0967a0885c80d3820c0614560 /django/validationmanager
parent56641b346180779cdb17e351f453513db4d702c9 (diff)
Fix flake8 remaining problems
shorter lines in files commited Change-Id: If2a232b0f83f135b60fd74833113e6ac7c0533e2 Issue-ID: VVP-25 Signed-off-by: Almog Laktivi <al942u@att.com>
Diffstat (limited to 'django/validationmanager')
-rw-r--r--django/validationmanager/em_integration/vm_api.py24
-rw-r--r--django/validationmanager/tasks.py1
2 files changed, 13 insertions, 12 deletions
diff --git a/django/validationmanager/em_integration/vm_api.py b/django/validationmanager/em_integration/vm_api.py
index 6fb422b..d93dd5b 100644
--- a/django/validationmanager/em_integration/vm_api.py
+++ b/django/validationmanager/em_integration/vm_api.py
@@ -50,7 +50,8 @@ from engagementmanager.models import Engagement, IceUserProfile, \
ChecklistTemplate, VF
from engagementmanager.serializers import VFModelSerializerForSignal
from engagementmanager.utils.constants import Roles, EngagementStage, \
- CheckListLineType, JenkinsBuildParametersNames, RGWApermission, CheckListCategory
+ CheckListLineType, JenkinsBuildParametersNames, RGWApermission,\
+ CheckListCategory
from engagementmanager.utils.cryptography import CryptographyText
from engagementmanager.utils.validator import logEncoding
from mocks.gitlab_mock.rest.gitlab_files_respons_rest import \
@@ -105,16 +106,17 @@ def cl_from_pending_to_automation_callback(vf, checklist):
logger.debug(
"Engagement Manager has signaled that a checklist state was " +
"changed from pending to automation")
- if checklist.template and checklist.template.category == CheckListCategory.glance.name:
- logger.debug("Triggering image scan")
- request_scan(vf, checklist)
- elif checklist.template and checklist.template.category == CheckListCategory.heat.name:
- logger.debug("Triggering heat template validation")
- get_jenkins_client().build_job(
- vf.jenkins_job_name(), {
- 'checklist_uuid': checklist.uuid,
- 'git_repo_url': vf.git_repo_url,
- })
+ if checklist.template:
+ if checklist.template.category == CheckListCategory.glance.name:
+ logger.debug("Triggering image scan")
+ request_scan(vf, checklist)
+ elif checklist.template.category == CheckListCategory.heat.name:
+ logger.debug("Triggering heat template validation")
+ get_jenkins_client().build_job(
+ vf.jenkins_job_name(), {
+ 'checklist_uuid': checklist.uuid,
+ 'git_repo_url': vf.git_repo_url,
+ })
def provision_new_vf_callback(vf):
diff --git a/django/validationmanager/tasks.py b/django/validationmanager/tasks.py
index 5d7b0d2..87f414f 100644
--- a/django/validationmanager/tasks.py
+++ b/django/validationmanager/tasks.py
@@ -1,6 +1,5 @@
from celery import Celery
from django.conf import settings
-from engagementmanager.models import CheckListState
celery_app = Celery(
broker='redis://redis',