From 974ab6c42c6fa5bd45a96516f0c995ddc0cd7561 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 3 Aug 2016 11:13:27 -0400 Subject: [PATCH] Add missing arg to validate call and add logging --- health/services.py | 3 ++- storage/local.py | 2 +- storage/swift.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/health/services.py b/health/services.py index 26c8efa31..a56422ad7 100644 --- a/health/services.py +++ b/health/services.py @@ -37,7 +37,8 @@ def _check_storage(app): try: storage.validate(storage.preferred_locations, app.config['HTTPCLIENT']) return True - except: + except Exception as ex: + logger.exception('Storage check failed with exception %s', ex) return False diff --git a/storage/local.py b/storage/local.py index af13389e4..62f36adc3 100644 --- a/storage/local.py +++ b/storage/local.py @@ -115,7 +115,7 @@ class LocalStorage(BaseStorageV2): os.remove(content_path) def validate(self, client): - super(LocalStorage, self).validate() + super(LocalStorage, self).validate(client) # Load the set of disk mounts. try: diff --git a/storage/swift.py b/storage/swift.py index 8e206f23f..264d7d2e6 100644 --- a/storage/swift.py +++ b/storage/swift.py @@ -158,7 +158,7 @@ class SwiftStorage(BaseStorage): return surl.format(scheme=scheme, host=hostname, full_path=full_path, sig=sig, expires=expires) def validate(self, client): - super(SwiftStorage, self).validate() + super(SwiftStorage, self).validate(client) if self._temp_url_key: # Generate a direct download URL.