Rename secscan_endpoint where required, fix index and indentation
This commit is contained in:
parent
fa0897faae
commit
16c364a90c
2 changed files with 12 additions and 12 deletions
|
@ -5,7 +5,7 @@ import features
|
|||
import json
|
||||
import requests
|
||||
|
||||
from app import sec_endpoint
|
||||
from app import secscan_endpoint
|
||||
from data import model
|
||||
from endpoints.api import (require_repo_read, NotFound, DownstreamIssue, path_param,
|
||||
RepositoryParamResource, resource, nickname, show_if, parse_args,
|
||||
|
@ -18,7 +18,7 @@ logger = logging.getLogger(__name__)
|
|||
def _call_security_api(relative_url, *args, **kwargs):
|
||||
""" Issues an HTTP call to the sec API at the given relative URL. """
|
||||
try:
|
||||
response = sec_endpoint.call_api(relative_url, *args, **kwargs)
|
||||
response = secscan_endpoint.call_api(relative_url, *args, **kwargs)
|
||||
except requests.exceptions.Timeout:
|
||||
raise DownstreamIssue(payload=dict(message='API call timed out'))
|
||||
except requests.exceptions.ConnectionError:
|
||||
|
|
|
@ -12,7 +12,7 @@ from endpoints.notificationhelper import spawn_notification
|
|||
from collections import defaultdict
|
||||
from sys import exc_info
|
||||
from peewee import JOIN_LEFT_OUTER
|
||||
from app import app, storage, OVERRIDE_CONFIG_DIRECTORY, sec_endpoint
|
||||
from app import app, storage, OVERRIDE_CONFIG_DIRECTORY, secscan_endpoint
|
||||
from workers.worker import Worker
|
||||
from data.database import (Image, ImageStorage, ImageStorageLocation, ImageStoragePlacement,
|
||||
db_random_func, UseThenDisconnect, RepositoryTag, Repository,
|
||||
|
@ -49,8 +49,8 @@ def _get_image_to_export(version):
|
|||
|
||||
for image in images:
|
||||
rimages.append({'image_id': image[0],
|
||||
'docker_image_id': image[0],
|
||||
'storage_uuid': image[1],
|
||||
'docker_image_id': image[1],
|
||||
'storage_uuid': image[2],
|
||||
'parent_docker_image_id': None,
|
||||
'parent_storage_uuid': None})
|
||||
|
||||
|
@ -102,7 +102,7 @@ def _get_storage_locations(uuid):
|
|||
.switch(ImageStoragePlacement)
|
||||
.join(ImageStorage, JOIN_LEFT_OUTER)
|
||||
.where(ImageStorage.uuid == uuid))
|
||||
|
||||
return query.get()
|
||||
locations = list()
|
||||
for location in query:
|
||||
locations.append(location.location.name)
|
||||
|
@ -256,7 +256,7 @@ class SecurityWorker(Worker):
|
|||
# callback code, etc.
|
||||
try:
|
||||
logger.debug('Loading vulnerabilities for layer %s', img['image_id'])
|
||||
response = sec_endpoint.call_api('layers/%s/vulnerabilities', request['ID'])
|
||||
response = secscan_endpoint.call_api('layers/%s/vulnerabilities', request['ID'])
|
||||
except requests.exceptions.Timeout:
|
||||
logger.debug('Timeout when calling Sec')
|
||||
continue
|
||||
|
|
Reference in a new issue