summaryrefslogtreecommitdiff
path: root/swift/common/ring/utils.py
diff options
context:
space:
mode:
authorKun Huang <academicgareth@gmail.com>2013-02-25 22:52:39 +0800
committerKun Huang <academicgareth@gmail.com>2013-02-25 23:08:55 +0800
commitd9130d79e5fbabef4622dc97a8832e6f83bc3522 (patch)
tree8aa99886c5b31f8af52724a1139a048ad35cf28e /swift/common/ring/utils.py
parentd1381ba86b4a3ced781fa4e841c5c406fa7c504a (diff)
downloadswift-d9130d79e5fbabef4622dc97a8832e6f83bc3522.tar.gz
Correct docstring for swift.common.ring.utils.build_tier_tree and add
unit test for it. Some mistakes is in original docstring of that method. There's no unit test for two methods in swift.common.ring.utils. Fixes: bug #1070621 Change-Id: I6f4f211ea67d7fb8ccfe659f30bb0f5d394aca6b
Diffstat (limited to 'swift/common/ring/utils.py')
-rw-r--r--swift/common/ring/utils.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/swift/common/ring/utils.py b/swift/common/ring/utils.py
index afe1a16a4..4887b6b87 100644
--- a/swift/common/ring/utils.py
+++ b/swift/common/ring/utils.py
@@ -58,8 +58,8 @@ def build_tier_tree(devices):
(1,): [(1, 192.168.1.1:6000),
(1, 192.168.1.2:6000)],
- (2,): [(1, 192.168.2.1:6000),
- (1, 192.168.2.2:6000)],
+ (2,): [(2, 192.168.2.1:6000),
+ (2, 192.168.2.2:6000)],
(1, 192.168.1.1:6000): [(1, 192.168.1.1:6000, 0),
(1, 192.168.1.1:6000, 1),
@@ -67,12 +67,12 @@ def build_tier_tree(devices):
(1, 192.168.1.2:6000): [(1, 192.168.1.2:6000, 3),
(1, 192.168.1.2:6000, 4),
(1, 192.168.1.2:6000, 5)],
- (2, 192.168.2.1:6000): [(1, 192.168.2.1:6000, 6),
- (1, 192.168.2.1:6000, 7),
- (1, 192.168.2.1:6000, 8)],
- (2, 192.168.2.2:6000): [(1, 192.168.2.2:6000, 9),
- (1, 192.168.2.2:6000, 10),
- (1, 192.168.2.2:6000, 11)],
+ (2, 192.168.2.1:6000): [(2, 192.168.2.1:6000, 6),
+ (2, 192.168.2.1:6000, 7),
+ (2, 192.168.2.1:6000, 8)],
+ (2, 192.168.2.2:6000): [(2, 192.168.2.2:6000, 9),
+ (2, 192.168.2.2:6000, 10),
+ (2, 192.168.2.2:6000, 11)],
}
:devices: device dicts from which to generate the tree