summaryrefslogtreecommitdiff
path: root/swift/proxy/controllers/base.py
diff options
context:
space:
mode:
authorTim Burke <tim.burke@gmail.com>2020-03-06 16:16:20 -0800
committerTim Burke <tim.burke@gmail.com>2020-03-06 16:16:20 -0800
commit601ced55757ee8081710ccb0553d8447263e7c7d (patch)
tree950ec14b8b0d8f4787347c65123eabf3d8418281 /swift/proxy/controllers/base.py
parent71cc3681798d7e66fcb9c1ebd56f47849773eab8 (diff)
downloadswift-601ced55757ee8081710ccb0553d8447263e7c7d.tar.gz
Delay ring lookup until we know we need it
Change-Id: I6bc912ce5eee95b443e1e260bc445c58efb2fbf8 Closes-Bug: #1699726
Diffstat (limited to 'swift/proxy/controllers/base.py')
-rw-r--r--swift/proxy/controllers/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/swift/proxy/controllers/base.py b/swift/proxy/controllers/base.py
index dee61495e..2d470553c 100644
--- a/swift/proxy/controllers/base.py
+++ b/swift/proxy/controllers/base.py
@@ -1682,7 +1682,6 @@ class Controller(object):
:returns: tuple of (account partition, account nodes, container_count)
or (None, None, None) if it does not exist
"""
- partition, nodes = self.app.account_ring.get_nodes(account)
if req:
env = getattr(req, 'environ', {})
else:
@@ -1697,6 +1696,7 @@ class Controller(object):
or not info.get('account_really_exists', True)):
return None, None, None
container_count = info['container_count']
+ partition, nodes = self.app.account_ring.get_nodes(account)
return partition, nodes, container_count
def container_info(self, account, container, req=None):
@@ -1713,7 +1713,6 @@ class Controller(object):
and container sync key ('sync_key').
Values are set to None if the container does not exist.
"""
- part, nodes = self.app.container_ring.get_nodes(account, container)
if req:
env = getattr(req, 'environ', {})
else:
@@ -1728,6 +1727,7 @@ class Controller(object):
info['partition'] = None
info['nodes'] = None
else:
+ part, nodes = self.app.container_ring.get_nodes(account, container)
info['partition'] = part
info['nodes'] = nodes
return info