diff options
-rw-r--r-- | src/buildstream/_artifactcache.py | 3 | ||||
-rw-r--r-- | src/buildstream/_assetcache.py | 11 | ||||
-rw-r--r-- | src/buildstream/_sourcecache.py | 3 |
3 files changed, 6 insertions, 11 deletions
diff --git a/src/buildstream/_artifactcache.py b/src/buildstream/_artifactcache.py index 932db93ff..2a5f5faa6 100644 --- a/src/buildstream/_artifactcache.py +++ b/src/buildstream/_artifactcache.py @@ -21,7 +21,7 @@ import os import grpc -from ._assetcache import AssetCache, AssetRemote +from ._assetcache import AssetCache from ._cas.casremote import BlobNotFound from ._exceptions import ArtifactError, AssetCacheError, CASError, CASRemoteError from ._protos.buildstream.v2 import artifact_pb2 @@ -40,7 +40,6 @@ class ArtifactCache(AssetCache): spec_name = "artifact_cache_specs" config_node_name = "artifacts" - index_remote_class = AssetRemote def __init__(self, context): super().__init__(context) diff --git a/src/buildstream/_assetcache.py b/src/buildstream/_assetcache.py index 7df76dbc5..68f7fd732 100644 --- a/src/buildstream/_assetcache.py +++ b/src/buildstream/_assetcache.py @@ -265,8 +265,6 @@ class AssetCache: # pylint to some degree spec_name = None # type: str config_node_name = None # type: str - index_remote_class = None # type: Type[BaseRemote] - storage_remote_class = CASRemote # type: Type[BaseRemote] def __init__(self, context): self.context = context @@ -495,12 +493,11 @@ class AssetCache: # are accessible. # # Args: - # on_failure (Callable[[self.remote_class,Exception],None]): + # on_failure (Callable[[Remote,Exception],None]): # What do do when a remote doesn't respond. # # Returns: - # (Dict[RemoteSpec, self.remote_class], Dict[RemoteSpec, - # self.remote_class]) - + # (Dict[RemoteSpec, AssetRemote], Dict[RemoteSpec, CASRemote]) - # The created remote instances, index first, storage last. # def _create_remote_instances(self, *, on_failure=None): @@ -568,10 +565,10 @@ class AssetCache: index = None storage = None if remote_spec.type in [RemoteType.INDEX, RemoteType.ALL]: - index = self.index_remote_class(remote_spec) # pylint: disable=not-callable + index = AssetRemote(remote_spec) # pylint: disable=not-callable index.check() if remote_spec.type in [RemoteType.STORAGE, RemoteType.ALL]: - storage = self.storage_remote_class(remote_spec, self.cas) + storage = CASRemote(remote_spec, self.cas) storage.check() return (index, storage) diff --git a/src/buildstream/_sourcecache.py b/src/buildstream/_sourcecache.py index a05344de4..fd75be34d 100644 --- a/src/buildstream/_sourcecache.py +++ b/src/buildstream/_sourcecache.py @@ -22,7 +22,7 @@ import grpc from ._cas.casremote import BlobNotFound from .storage._casbaseddirectory import CasBasedDirectory -from ._assetcache import AssetCache, AssetRemote +from ._assetcache import AssetCache from ._exceptions import CASError, CASRemoteError, SourceCacheError from . import utils from ._protos.buildstream.v2 import source_pb2 @@ -39,7 +39,6 @@ class SourceCache(AssetCache): spec_name = "source_cache_specs" config_node_name = "source-caches" - index_remote_class = AssetRemote def __init__(self, context): super().__init__(context) |