from twisted.application import service
from twisted.internet import defer
+from allmydata.util.assertutil import precondition
from allmydata.util.deferredutil import async_iterate, gatherResults
from allmydata.storage.common import si_b2a
from allmydata.storage.bucket import BucketReader
test_good = False
break
return test_good
+
+
+# Originally from txaws.s3.model (under different class names), which was under the MIT / Expat licence.
+
+class ContainerItem(object):
+ """
+ An item in a listing of cloud objects.
+ """
+ def __init__(self, key, modification_date, etag, size, storage_class,
+ owner=None):
+ self.key = key
+ self.modification_date = modification_date
+ self.etag = etag
+ self.size = size
+ self.storage_class = storage_class
+ self.owner = owner
+
+ def __repr__(self):
+ return "<ContainerItem %r>" % ({
+ "key": self.key,
+ "modification_date": self.modification_date,
+ "etag": self.etag,
+ "size": self.size,
+ "storage_class": self.storage_class,
+ "owner": self.owner,
+ },)
+
+
+class ContainerListing(object):
+ def __init__(self, name, prefix, marker, max_keys, is_truncated,
+ contents=None, common_prefixes=None):
+ precondition(isinstance(is_truncated, str))
+ self.name = name
+ self.prefix = prefix
+ self.marker = marker
+ self.max_keys = max_keys
+ self.is_truncated = is_truncated
+ self.contents = contents
+ self.common_prefixes = common_prefixes
+
+ def __repr__(self):
+ return "<ContainerListing %r>" % ({
+ "name": self.name,
+ "prefix": self.prefix,
+ "marker": self.marker,
+ "max_keys": self.max_keys,
+ "is_truncated": self.is_truncated,
+ "contents": self.contents,
+ "common_prefixes": self.common_prefixes,
+ })
raise NotImplementedError
-# Originally from txaws.s3.model (under different class names), which was under the MIT / Expat licence.
-
-class ContainerItem(object):
- """
- An item in a listing of cloud objects.
- """
- def __init__(self, key, modification_date, etag, size, storage_class,
- owner=None):
- self.key = key
- self.modification_date = modification_date
- self.etag = etag
- self.size = size
- self.storage_class = storage_class
- self.owner = owner
-
- def __repr__(self):
- return "<ContainerItem %r>" % ({
- "key": self.key,
- "modification_date": self.modification_date,
- "etag": self.etag,
- "size": self.size,
- "storage_class": self.storage_class,
- "owner": self.owner,
- },)
-
-
-class ContainerListing(object):
- def __init__(self, name, prefix, marker, max_keys, is_truncated,
- contents=None, common_prefixes=None):
- precondition(isinstance(is_truncated, str))
- self.name = name
- self.prefix = prefix
- self.marker = marker
- self.max_keys = max_keys
- self.is_truncated = is_truncated
- self.contents = contents
- self.common_prefixes = common_prefixes
-
- def __repr__(self):
- return "<ContainerListing %r>" % ({
- "name": self.name,
- "prefix": self.prefix,
- "marker": self.marker,
- "max_keys": self.max_keys,
- "is_truncated": self.is_truncated,
- "contents": self.contents,
- "common_prefixes": self.common_prefixes,
- })
-
-
BACKOFF_SECONDS_BEFORE_RETRY = (0, 2, 10)
from zope.interface import implements
from allmydata.util import log
+from allmydata.storage.backends.base import ContainerItem, ContainerListing
from allmydata.storage.backends.cloud.cloud_common import IContainer, \
- ContainerItem, ContainerListing, CommonContainerMixin, HTTPClientMixin
+ CommonContainerMixin, HTTPClientMixin
class AuthenticationClient(object):
from zope.interface import implements
from allmydata.util.assertutil import _assert
+from allmydata.storage.backends.base import ContainerItem, ContainerListing
from allmydata.storage.backends.cloud.cloud_common import IContainer, \
- CloudServiceError, ContainerItem, ContainerListing, \
- CommonContainerMixin, ContainerListMixin
+ CloudServiceError, CommonContainerMixin, ContainerListMixin
from allmydata.util.time_format import iso_utc
from allmydata.util import fileutil
from twisted.web.http_headers import Headers
from twisted.web.http import datetimeToString
+from allmydata.storage.backends.base import ContainerItem, ContainerListing
from allmydata.storage.backends.cloud.cloud_common import IContainer, \
- ContainerItem, ContainerListing, CommonContainerMixin, HTTPClientMixin
+ CommonContainerMixin, HTTPClientMixin
class MSAzureStorageContainer(CommonContainerMixin, HTTPClientMixin):
from allmydata.util import log
from allmydata.node import InvalidValueError
+from allmydata.storage.backends.base import ContainerItem, ContainerListing
from allmydata.storage.backends.cloud.cloud_common import IContainer, \
- CloudServiceError, ContainerItem, ContainerListing, CommonContainerMixin, \
- HTTPClientMixin
+ CloudServiceError, CommonContainerMixin, HTTPClientMixin
# Enabling this will cause secrets to be logged.
from allmydata.util.assertutil import precondition
from allmydata.util import fileutil, hashutil, base32, time_format
from allmydata.storage.server import StorageServer
+from allmydata.storage.backends.base import ContainerItem, ContainerListing
from allmydata.storage.backends.null.null_backend import NullBackend
from allmydata.storage.backends.disk.disk_backend import DiskBackend
from allmydata.storage.backends.disk.immutable import load_immutable_disk_share, \
create_immutable_disk_share, ImmutableDiskShare
from allmydata.storage.backends.disk.mutable import create_mutable_disk_share, MutableDiskShare
from allmydata.storage.backends.cloud.cloud_backend import CloudBackend
-from allmydata.storage.backends.cloud.cloud_common import CloudError, CloudServiceError, \
- ContainerItem, ContainerListing
+from allmydata.storage.backends.cloud.cloud_common import CloudError, CloudServiceError
from allmydata.storage.backends.cloud.mutable import MutableCloudShare
from allmydata.storage.backends.cloud import mock_cloud, cloud_common
from allmydata.storage.backends.cloud.mock_cloud import MockContainer