def create(configuration): fs_section = configuration.get("fs", {}) if not fs_section: # backward compatibility options = {} arch_section = configuration.get('archive') try: options['root'] = config.parse(arch_section['root'], Text) except KeyError: raise ValueError( 'archive: storage: fs: no value for mandatory item "root"') try: options['use_symlinks'] = config.parse( arch_section['use_symlinks'], Boolean) except KeyError: pass else: options = config.parse(fs_section, _FSConfig) _FSConfig.validate(options) return FilesystemStorageBackend(**options)
def create(configuration): options = config.parse(configuration.get("sqlite", {}), _SQLiteConfig) _SQLiteConfig.validate(options) return SQLiteBackend(**options)
def create(configuration): options = config.parse(configuration.get("s3", {}), _S3Config) _S3Config.validate(options) return S3StorageBackend(**options)
def create(configuration): options = config.parse(configuration.get("postgresql", {}), _PostgresqlConfig) _PostgresqlConfig.validate(options) return PostgresqlBackend(**options)