initial import for Open Source 🎉
This commit is contained in:
parent
1898c361f3
commit
9c0dd3b722
2048 changed files with 218743 additions and 0 deletions
24
util/config/validators/validate_actionlog_archiving.py
Normal file
24
util/config/validators/validate_actionlog_archiving.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from util.config.validators import BaseValidator, ConfigValidationException
|
||||
|
||||
class ActionLogArchivingValidator(BaseValidator):
|
||||
name = "actionlogarchiving"
|
||||
|
||||
@classmethod
|
||||
def validate(cls, validator_context):
|
||||
config = validator_context.config
|
||||
|
||||
""" Validates the action log archiving configuration. """
|
||||
if not config.get('FEATURE_ACTION_LOG_ROTATION', False):
|
||||
return
|
||||
|
||||
if not config.get('ACTION_LOG_ARCHIVE_PATH'):
|
||||
raise ConfigValidationException('Missing action log archive path')
|
||||
|
||||
if not config.get('ACTION_LOG_ARCHIVE_LOCATION'):
|
||||
raise ConfigValidationException('Missing action log archive storage location')
|
||||
|
||||
location = config['ACTION_LOG_ARCHIVE_LOCATION']
|
||||
storage_config = config.get('DISTRIBUTED_STORAGE_CONFIG') or {}
|
||||
if location not in storage_config:
|
||||
msg = 'Action log archive storage location `%s` not found in storage config' % location
|
||||
raise ConfigValidationException(msg)
|
Reference in a new issue