summaryrefslogtreecommitdiffstats
path: root/gluster/swift/common/constraints.py
diff options
context:
space:
mode:
authorvenkata edara <redara@redhat.com>2017-05-10 13:27:38 +0530
committerPrashanth Pai <ppai@redhat.com>2017-05-11 05:48:27 +0000
commit513988915aa1af13a989d062b021fe1562cbf18d (patch)
tree1c281911e3a9bfa97f8a7285f20691cb77c45c1d /gluster/swift/common/constraints.py
parente9c2c5eb55e1012ccce0ce51ac48bed0c0f1d4b7 (diff)
Rebase to Swift 2.10.1 (newton)
Change-Id: I53a962c9a301089c8aed0b43c50f944c30225944 Signed-off-by: venkata edara <redara@redhat.com> Reviewed-on: https://review.gluster.org/16653 Reviewed-by: Prashanth Pai <ppai@redhat.com> Tested-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'gluster/swift/common/constraints.py')
-rw-r--r--gluster/swift/common/constraints.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/gluster/swift/common/constraints.py b/gluster/swift/common/constraints.py
index 98e2a27..2007b71 100644
--- a/gluster/swift/common/constraints.py
+++ b/gluster/swift/common/constraints.py
@@ -102,3 +102,14 @@ _ring.Ring = ring.Ring
import swift.account.utils
from gluster.swift.account.utils import account_listing_response as gf_als
swift.account.utils.account_listing_response = gf_als
+
+# Monkey patch StoragePolicy.load_ring as POLICIES are initialized already
+from swift.common.storage_policy import StoragePolicy
+
+
+def load_ring(self, swift_dir):
+ if self.object_ring:
+ return
+ self.object_ring = ring.Ring(swift_dir, ring_name='object')
+
+StoragePolicy.load_ring = load_ring