summaryrefslogtreecommitdiffstats
path: root/gluster/swift/common/constraints.py
diff options
context:
space:
mode:
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