Revert local validation context, extract another util

This commit is contained in:
Sam Chow 2018-06-28 19:42:08 -04:00 committed by Sam Chow
parent d7ffb54333
commit 14fefea38f
6 changed files with 18 additions and 24 deletions

View file

@ -1,4 +1,4 @@
from storage import get_storage_driver
from storage import get_storage_driver, TYPE_LOCAL_STORAGE
from util.config.validators import BaseValidator, ConfigValidationException
@ -12,7 +12,6 @@ class StorageValidator(BaseValidator):
client = validator_context.http_client
ip_resolver = validator_context.ip_resolver
config_provider = validator_context.config_provider
skip_localstorage_validation = validator_context.skip_localstorage_validation
replication_enabled = config.get('FEATURE_STORAGE_REPLICATION', False)
@ -21,7 +20,9 @@ class StorageValidator(BaseValidator):
raise ConfigValidationException('Storage configuration required')
for name, (storage_type, driver) in providers:
if skip_localstorage_validation and storage_type == 'LocalStorage':
# We can skip localstorage validation, since we can't guarantee that
# this will be the same machine Q.E. will run under
if storage_type == TYPE_LOCAL_STORAGE:
continue
try: