diff --git a/swift/common/constraints.py b/swift/common/constraints.py index 03a22e1049..005c7875f9 100644 --- a/swift/common/constraints.py +++ b/swift/common/constraints.py @@ -385,9 +385,11 @@ check_container_format = functools.partial(check_name_format, def valid_api_version(version): - """ Checks if the requested version is valid. + """ + Checks if the requested version is valid. - Currently Swift only supports "v1" and "v1.0". """ + Currently Swift only supports "v1" and "v1.0". + """ global VALID_API_VERSIONS if not isinstance(VALID_API_VERSIONS, list): VALID_API_VERSIONS = [str(VALID_API_VERSIONS)] diff --git a/swift/common/ring/builder.py b/swift/common/ring/builder.py index ef4f095a95..6f4066b4d0 100644 --- a/swift/common/ring/builder.py +++ b/swift/common/ring/builder.py @@ -1693,13 +1693,13 @@ class RingBuilder(object): return matched_devs def increase_partition_power(self): - """ Increases ring partition power by one. + """ + Increases ring partition power by one. Devices will be assigned to partitions like this: OLD: 0, 3, 7, 5, 2, 1, ... NEW: 0, 0, 3, 3, 7, 7, 5, 5, 2, 2, 1, 1, ... - """ new_replica2part2dev = [] diff --git a/test/unit/cli/test_ringbuilder.py b/test/unit/cli/test_ringbuilder.py index e36d447279..b3e33acb54 100644 --- a/test/unit/cli/test_ringbuilder.py +++ b/test/unit/cli/test_ringbuilder.py @@ -132,7 +132,8 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin): self.fail(msg) def create_sample_ring(self, part_power=6): - """ Create a sample ring with four devices + """ + Create a sample ring with four devices At least four devices are needed to test removing a device, since having less devices than replicas diff --git a/tox.ini b/tox.ini index 6780a68416..bee5ada633 100644 --- a/tox.ini +++ b/tox.ini @@ -100,12 +100,10 @@ commands = bandit -c bandit.yaml -r swift -n 5 # H202: assertRaises Exception too broad # H301: one import per line # H306: imports not in alphabetical order (time, os) -# H401: docstring should not start with a space -# H403: multi line docstrings should end on a new line # H404: multi line docstring should start without a leading new line # H405: multi line docstring summary not separated with an empty line # H501: Do not use self.__dict__ for string formatting -ignore = H101,H202,H301,H306,H401,H403,H404,H405,H501 +ignore = H101,H202,H301,H306,H404,H405,H501 exclude = .venv,.tox,dist,*egg filename = *.py,bin/* show-source = True