diff options
author | Monty Taylor <mordred@inaugust.com> | 2010-07-13 16:36:06 -0500 |
---|---|---|
committer | Monty Taylor <mordred@inaugust.com> | 2010-07-13 16:36:06 -0500 |
commit | 02622ba3acf466e18180357a4dab88a52bae39ca (patch) | |
tree | ccbd81fb3d71b572b8f3e1a51320f9e6eb621e5c | |
parent | 05e914ecaa4e930e9048cd4f72267e4fd8db10e2 (diff) | |
parent | 7b38b9a19a10a63ad490af95a1866c1222e59159 (diff) | |
download | swift-02622ba3acf466e18180357a4dab88a52bae39ca.tar.gz |
Merged trunk.
-rw-r--r-- | AUTHORS | 2 | ||||
-rw-r--r-- | swift/proxy/server.py | 11 | ||||
-rw-r--r-- | test/unit/proxy/test_server.py | 21 |
3 files changed, 17 insertions, 17 deletions
@@ -1,7 +1,7 @@ Maintainer ---------- OpenStack, LLC. -IRC: #openstack +IRC: #openstack on irc.freenode.net Original Authors ---------------- diff --git a/swift/proxy/server.py b/swift/proxy/server.py index a0804826a..102afa68e 100644 --- a/swift/proxy/server.py +++ b/swift/proxy/server.py @@ -934,7 +934,8 @@ class BaseApplication(object): log_name = 'base_application' - def __init__(self, conf, memcache, logger=None): + def __init__(self, conf, memcache, logger=None, account_ring=None, + container_ring=None, object_ring=None): if logger: self.logger = logger else: @@ -961,10 +962,12 @@ class BaseApplication(object): int(conf.get('recheck_account_existence', 60)) self.resellers_conf = ConfigParser() self.resellers_conf.read(os.path.join(swift_dir, 'resellers.conf')) - self.object_ring = Ring(os.path.join(swift_dir, 'object.ring.gz')) - self.container_ring = \ + self.object_ring = object_ring or \ + Ring(os.path.join(swift_dir, 'object.ring.gz')) + self.container_ring = container_ring or \ Ring(os.path.join(swift_dir, 'container.ring.gz')) - self.account_ring = Ring(os.path.join(swift_dir, 'account.ring.gz')) + self.account_ring = account_ring or \ + Ring(os.path.join(swift_dir, 'account.ring.gz')) self.memcache = memcache self.rate_limit = float(conf.get('rate_limit', 20000.0)) self.account_rate_limit = float(conf.get('account_rate_limit', 200.0)) diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py index c7180e0a4..ad96f812a 100644 --- a/test/unit/proxy/test_server.py +++ b/test/unit/proxy/test_server.py @@ -191,10 +191,9 @@ def save_globals(): class TestObjectController(unittest.TestCase): def setUp(self): - self.app = proxy_server.Application(None, FakeMemcache()) - self.app.object_ring = FakeRing() - self.app.container_ring = FakeRing() - self.app.account_ring = FakeRing() + self.app = proxy_server.Application(None, FakeMemcache(), + account_ring=FakeRing(), container_ring=FakeRing(), + object_ring=FakeRing()) def assert_status_map(self, method, statuses, expected, raise_exc=False): with save_globals(): @@ -1447,10 +1446,9 @@ class TestContainerController(unittest.TestCase): "Test swift.proxy_server.ContainerController" def setUp(self): - self.app = proxy_server.Application(None, FakeMemcache()) - self.app.object_ring = FakeRing() - self.app.container_ring = FakeRing() - self.app.account_ring = FakeRing() + self.app = proxy_server.Application(None, FakeMemcache(), + account_ring=FakeRing(), container_ring=FakeRing(), + object_ring=FakeRing()) def assert_status_map(self, method, statuses, expected, raise_exc=False, missing_container=False): with save_globals(): @@ -1635,10 +1633,9 @@ class TestContainerController(unittest.TestCase): class TestAccountController(unittest.TestCase): def setUp(self): - self.app = proxy_server.Application(None, FakeMemcache()) - self.app.object_ring = FakeRing() - self.app.container_ring = FakeRing() - self.app.account_ring = FakeRing() + self.app = proxy_server.Application(None, FakeMemcache(), + account_ring=FakeRing(), container_ring=FakeRing(), + object_ring=FakeRing) def assert_status_map(self, method, statuses, expected): with save_globals(): |