Add storage validation to the status endpoint

Fixes #1659
This commit is contained in:
Joseph Schorr 2016-08-01 13:02:15 -04:00
parent abce6a8dbc
commit c30b8dd1ad
3 changed files with 19 additions and 3 deletions

View file

@ -1,6 +1,6 @@
import logging
from data.model import health
from app import build_logs
from app import build_logs, storage
logger = logging.getLogger(__name__)
@ -32,11 +32,20 @@ def _check_redis(app):
""" Returns the status of Redis, as accessed from this instance. """
return build_logs.check_health()
def _check_storage(app):
""" Returns the status of storage, as accessed from this instance. """
try:
storage.validate(storage.preferred_locations, app.config['HTTPCLIENT'])
return True
except:
return False
_SERVICES = {
'registry_gunicorn': _check_registry_gunicorn,
'database': _check_database,
'redis': _check_redis
'redis': _check_redis,
'storage': _check_storage,
}
def check_all_services(app, skip):