Rename s/storage/backend for consistency

This commit is contained in:
Rafa de la Torre 2016-10-04 14:59:57 +02:00
parent 3844cfc226
commit e1b357137a
2 changed files with 10 additions and 10 deletions

View File

@ -4,21 +4,21 @@ from cartodb_services.refactor.storage.redis_config import RedisOrgConfigStorage
class OrgConfigBackendFactory(object):
"""
This class abstracts the creation of an org configuration storage. It will return
This class abstracts the creation of an org configuration backend. It will return
an implementation of the ConfigBackendInterface appropriate to the org, depending
on the environment.
"""
def __init__(self, orgname, environment, server_config_storage):
def __init__(self, orgname, environment, server_config_backend):
self._orgname = orgname
self._environment = environment
self._server_config_storage = server_config_storage
self._server_config_backend = server_config_backend
def get(self):
if self._environment.is_onpremise:
org_config_backend = self._server_config_storage
org_config_backend = self._server_config_backend
else:
redis_metadata_connection_config = RedisMetadataConnectionConfigBuilder(self._server_config_storage).get()
redis_metadata_connection_config = RedisMetadataConnectionConfigBuilder(self._server_config_backend).get()
redis_metadata_connection = RedisConnectionBuilder(redis_metadata_connection_config).get()
org_config_backend = RedisOrgConfigStorageBuilder(redis_metadata_connection, self._orgname).get()
return org_config_backend

View File

@ -4,21 +4,21 @@ from cartodb_services.refactor.storage.redis_config import RedisUserConfigStorag
class UserConfigBackendFactory(object):
"""
This class abstracts the creation of a user configuration storage. It will return
This class abstracts the creation of a user configuration backend. It will return
an implementation of the ConfigBackendInterface appropriate to the user, depending
on the environment.
"""
def __init__(self, username, environment, server_config_storage):
def __init__(self, username, environment, server_config_backend):
self._username = username
self._environment = environment
self._server_config_storage = server_config_storage
self._server_config_backend = server_config_backend
def get(self):
if self._environment.is_onpremise:
user_config_backend = self._server_config_storage
user_config_backend = self._server_config_backend
else:
redis_metadata_connection_config = RedisMetadataConnectionConfigBuilder(self._server_config_storage).get()
redis_metadata_connection_config = RedisMetadataConnectionConfigBuilder(self._server_config_backend).get()
redis_metadata_connection = RedisConnectionBuilder(redis_metadata_connection_config).get()
user_config_backend = RedisUserConfigStorageBuilder(redis_metadata_connection, self._username).get()
return user_config_backend