Update use of safe_load and safe_dump to load and dump using the CSafeLoader with SafeLoader as a fallback. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
24 lines
590 B
Python
24 lines
590 B
Python
from __future__ import unicode_literals
|
|
|
|
import yaml
|
|
try:
|
|
from yaml import CSafeLoader as SafeLoader
|
|
except ImportError:
|
|
from yaml import SafeLoader
|
|
|
|
from django.utils.module_loading import import_string
|
|
|
|
from .settings import (
|
|
setting_staging_file_image_cache_storage,
|
|
setting_staging_file_image_cache_storage_arguments,
|
|
)
|
|
|
|
storage_staging_file_image_cache = import_string(
|
|
dotted_path=setting_staging_file_image_cache_storage.value
|
|
)(
|
|
**yaml.load(
|
|
stream=setting_staging_file_image_cache_storage_arguments.value or '{}',
|
|
Loader=SafeLoader
|
|
)
|
|
)
|