From: Daira Hopwood Date: Sat, 26 Apr 2014 20:25:28 +0000 (+0100) Subject: Add Namespace class. X-Git-Url: https://git.rkrishnan.org/reliability?a=commitdiff_plain;h=803fee48e37c355dfa9f1802990529c7381f9fff;p=tahoe-lafs%2Ftahoe-lafs.git Add Namespace class. Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/storage/backends/cloud/mutable.py b/src/allmydata/storage/backends/cloud/mutable.py index 7c9a2ead..1b2ae8f7 100644 --- a/src/allmydata/storage/backends/cloud/mutable.py +++ b/src/allmydata/storage/backends/cloud/mutable.py @@ -10,6 +10,7 @@ from zope.interface import implements from allmydata.interfaces import IMutableShare, BadWriteEnablerError from allmydata.util import idlib, log from allmydata.util.assertutil import precondition, _assert +from allmydata.util.namespace import Namespace from allmydata.util.mathutil import div_ceil from allmydata.util.hashutil import timing_safe_compare from allmydata.storage.common import CorruptStoredShareError, UnknownMutableContainerVersionError, \ @@ -42,10 +43,6 @@ assert struct.calcsize(">L") == 4, struct.calcsize(">L") assert struct.calcsize(">Q") == 8, struct.calcsize(">Q") -class Namespace(object): - pass - - class MutableCloudShare(CloudShareBase, CloudShareReaderMixin): implements(IMutableShare) diff --git a/src/allmydata/test/test_iputil.py b/src/allmydata/test/test_iputil.py index 6a5b08f3..89da6a2a 100644 --- a/src/allmydata/test/test_iputil.py +++ b/src/allmydata/test/test_iputil.py @@ -4,12 +4,10 @@ import re, errno, subprocess, os from twisted.trial import unittest from allmydata.util import iputil +from allmydata.util.namespace import Namespace import allmydata.test.common_util as testutil -class Namespace: - pass - DOTTED_QUAD_RE=re.compile("^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$") MOCK_IPADDR_OUTPUT = """\ diff --git a/src/allmydata/test/test_storage.py b/src/allmydata/test/test_storage.py index d84a45a3..717da5e2 100644 --- a/src/allmydata/test/test_storage.py +++ b/src/allmydata/test/test_storage.py @@ -20,6 +20,7 @@ from foolscap.logging.web import LogEvent from allmydata import interfaces from allmydata.util.assertutil import precondition +from allmydata.util.namespace import Namespace from allmydata.util import fileutil, hashutil, base32, time_format from allmydata.storage.server import StorageServer from allmydata.storage.backends.base import ContainerItem, ContainerListing @@ -1530,10 +1531,6 @@ class MSAzureStorageBackendTests(unittest.TestCase, CloudStorageBackendMixin): self.failUnless(done) -class Namespace(object): - pass - - class AdminContainerTests(unittest.TestCase, WorkdirMixin): def test_admin_create_container(self): # We'll use the mock cloud backend to test this. diff --git a/src/allmydata/util/namespace.py b/src/allmydata/util/namespace.py new file mode 100644 index 00000000..c386b737 --- /dev/null +++ b/src/allmydata/util/namespace.py @@ -0,0 +1,3 @@ + +class Namespace(object): + pass