summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammed Junaid <junaid@redhat.com>2013-08-01 11:31:39 +0530
committerLuis Pabon <lpabon@redhat.com>2013-08-01 16:56:08 -0700
commitf54f00dc313d52414230e3c05dfa383ad7e7a8ce (patch)
tree4681537ced789c8e133df4aabf44387d01c58797
parent14181f5f95b5cf3767c50ae075d6ad3aca7e6805 (diff)
Handle the ring_name variable being none in Ring.__init__v1.8.0-5
Change-Id: Ifbcf217e525e50f62b98028ed5292be58db64bad Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/5454 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
-rw-r--r--gluster/swift/common/ring.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/gluster/swift/common/ring.py b/gluster/swift/common/ring.py
index d86a534..f4df8da 100644
--- a/gluster/swift/common/ring.py
+++ b/gluster/swift/common/ring.py
@@ -41,20 +41,24 @@ if not reseller_prefix.endswith('_'):
class Ring(ring.Ring):
- def __init__(self, serialized_path, *args, **kwargs):
+ def __init__(self, serialized_path, reload_time=15, ring_name=None):
self.false_node = {'zone': 1, 'weight': 100.0, 'ip': '127.0.0.1',
'id': 0, 'meta': '', 'device': 'volume_not_in_ring',
'port': 6012}
self.account_list = []
- ring_file = os.path.join(serialized_path, kwargs['ring_name']
- + '.ring.gz')
- if not os.path.exists(ring_file):
+ if ring_name:
+ _serialized_path = os.path.join(serialized_path,
+ ring_name + '.ring.gz')
+ else:
+ _serialized_path = os.path.join(serialized_path)
+
+ if not os.path.exists(_serialized_path):
raise OSError(errno.ENOENT, 'No such file or directory',
- 'ring files do not exists under %s, '
- 'aborting proxy-server start.' % serialized_path)
+ '%s ring file does not exists, aborting '
+ 'proxy-server start.' % _serialized_path)
- ring.Ring.__init__(self, serialized_path, *args, **kwargs)
+ ring.Ring.__init__(self, serialized_path, reload_time, ring_name)
def _get_part_nodes(self, part):
seen_ids = set()