Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
travis: set blank PIPENV_PYUP_API_KEY workaround
Browse files Browse the repository at this point in the history
for `pipenv check` pyup.io safety check.

pyup.io recently removed the requirement for a custom
API key for pipenv's safety check, and, until an
upstream pipenv release can be delivered, this is the
suggested workaround. Previously, an error occured during
`pipenv check` since pipenv was using an API key.

See `https://github.com/pypa/pipenv/issues/4188`
  • Loading branch information
theo-o committed May 5, 2020
1 parent 34d432e commit 46cec15
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cache:
env:
global:
- PIPENV_IGNORE_VIRTUALENVS=1
- PIPENV_PYUP_API_KEY=""
install:
- (cd manager && pipenv install --dev --deploy)
- (cd orchestrator && pipenv install --dev --deploy)
Expand Down
Empty file.
30 changes: 30 additions & 0 deletions orchestrator/orchestrator/views/registry/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-License-Identifier: MIT
# (c) 2019 The TJHSST Director 4.0 Development Team & Contributors
import traceback
from typing import Tuple, Union

from flask import Blueprint, current_app

from ....docker.registry import get_registry_images
from ..exceptions import OrchestratorActionError

api = Blueprint("api", __name__)


@api.route("/registry/api/images", method=["GET"])
def get_registry_images_page() -> Union[str, Tuple[str, int]]:
"""Returns Docker registry images.
Returns in JSON format.
"""

try:
images = get_registry_images()
except OrchestratorActionError as ex:
current_app.logger.error("%s", traceback.format_exc())
return str(ex), 500
except BaseException: # pylint: disable=broad-except
current_app.logger.error("%s", traceback.format_exc())
return "Error", 500
else:
return str(images)

0 comments on commit 46cec15

Please sign in to comment.