diff options
author | Peter Portante <peter.portante@redhat.com> | 2013-05-23 16:34:24 -0400 |
---|---|---|
committer | Luis Pabon <lpabon@redhat.com> | 2013-05-24 12:08:18 -0700 |
commit | b29164198523591a69b234e869b7a1b94bd4f08e (patch) | |
tree | 04a3787ea446cdc42d282d5483ad21841c880f70 /gluster/swift/common/ring.py | |
parent | 3ff44850b4b0151b55028d45c8c77a521c478b2c (diff) |
Add DiskDir unit test skeleton and pep8 filter
The new DiskDir unit test skeleton is quite incomplete, but gets the
DiskDir module on the board for modules covered, explicitly exposing
the fact that we need to get test coverage. This is a first step.
At the same time, we also update all the modules we have applying the
fix for pep8 errors now run under tox. We can then add a Jenkins
pre-commit job to fail on pep8 errors. This brings our code to parity
with what they are doing in OpenStack Swift.
Change-Id: Ia0565606512efda6e73f67bd00269177b89db858
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Reviewed-on: http://review.gluster.org/5080
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
Diffstat (limited to 'gluster/swift/common/ring.py')
-rw-r--r-- | gluster/swift/common/ring.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gluster/swift/common/ring.py b/gluster/swift/common/ring.py index 06aab8d..f88af4e 100644 --- a/gluster/swift/common/ring.py +++ b/gluster/swift/common/ring.py @@ -36,13 +36,12 @@ if conf_files and _conf.read(conf_file): if not reseller_prefix.endswith('_'): reseller_prefix = reseller_prefix + '_' + class Ring(ring.Ring): def _get_part_nodes(self, part): seen_ids = set() - nodes = [dev for dev in self._devs \ - if dev['device'] == self.acc_name \ - and not (dev['id'] in seen_ids \ - or seen_ids.add(dev['id']))] + nodes = [dev for dev in self._devs if dev['device'] == self.acc_name + and not (dev['id'] in seen_ids or seen_ids.add(dev['id']))] if not nodes: nodes = [self.false_node] return nodes @@ -86,8 +85,8 @@ class Ring(ring.Ring): hardware description ====== =============================================================== """ - self.false_node = {'zone': 1, 'weight': 100.0, 'ip': '127.0.0.1', 'id': 0, \ - 'meta': '', 'device': 'volume_not_in_ring', \ + self.false_node = {'zone': 1, 'weight': 100.0, 'ip': '127.0.0.1', + 'id': 0, 'meta': '', 'device': 'volume_not_in_ring', 'port': 6012} if account.startswith(reseller_prefix): self.acc_name = account.replace(reseller_prefix, '', 1) @@ -97,7 +96,6 @@ class Ring(ring.Ring): part = 0 return part, self._get_part_nodes(part) - def get_more_nodes(self, part): """ Generator to get extra nodes for a partition for hinted handoff. |