Fix several typos in the codebase.
These were found using https://github.com/intgr/topy Change-Id: I0dc7b76c44b8b17b1dcd79184dad1516fb11173c
This commit is contained in:
parent
6174ea470d
commit
032f0bfc7c
@ -35,7 +35,7 @@ def print_ring_locations(ring, datadir, account, container=None):
|
|||||||
|
|
||||||
:param ring: ring instance
|
:param ring: ring instance
|
||||||
:param datadir: high level directory to store account/container/objects
|
:param datadir: high level directory to store account/container/objects
|
||||||
:param acount: account name
|
:param account: account name
|
||||||
:param container: container name
|
:param container: container name
|
||||||
"""
|
"""
|
||||||
if ring is None or datadir is None or account is None:
|
if ring is None or datadir is None or account is None:
|
||||||
|
@ -209,7 +209,7 @@ class DatabaseBroker(object):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
"""
|
"""
|
||||||
Returns a string indentifying the entity under broker to a human.
|
Returns a string identifying the entity under broker to a human.
|
||||||
The baseline implementation returns a full pathname to a database.
|
The baseline implementation returns a full pathname to a database.
|
||||||
This is vital for useful diagnostics.
|
This is vital for useful diagnostics.
|
||||||
"""
|
"""
|
||||||
|
@ -242,7 +242,7 @@ class Manager(object):
|
|||||||
print _("%s (%s) appears to have stopped") % (server, killed_pid)
|
print _("%s (%s) appears to have stopped") % (server, killed_pid)
|
||||||
killed_pids.add(killed_pid)
|
killed_pids.add(killed_pid)
|
||||||
if not killed_pids.symmetric_difference(signaled_pids):
|
if not killed_pids.symmetric_difference(signaled_pids):
|
||||||
# all proccesses have been stopped
|
# all processes have been stopped
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
# reached interval n watch_pids w/o killing all servers
|
# reached interval n watch_pids w/o killing all servers
|
||||||
|
@ -207,7 +207,7 @@ class MemcacheRing(object):
|
|||||||
pass
|
pass
|
||||||
if got_connection:
|
if got_connection:
|
||||||
# We need to return something to the pool
|
# We need to return something to the pool
|
||||||
# A new connection will be created the next time it is retreived
|
# A new connection will be created the next time it is retrieved
|
||||||
self._return_conn(server, None, None)
|
self._return_conn(server, None, None)
|
||||||
now = time.time()
|
now = time.time()
|
||||||
self._errors[server].append(time.time())
|
self._errors[server].append(time.time())
|
||||||
|
@ -191,7 +191,7 @@ class ProxyLoggingMiddleware(object):
|
|||||||
start_time_str,
|
start_time_str,
|
||||||
end_time_str
|
end_time_str
|
||||||
)))
|
)))
|
||||||
# Log timing and bytes-transfered data to StatsD
|
# Log timing and bytes-transferred data to StatsD
|
||||||
metric_name = self.statsd_metric_name(req, status_int, method)
|
metric_name = self.statsd_metric_name(req, status_int, method)
|
||||||
# Only log data for valid controllers (or SOS) to keep the metric count
|
# Only log data for valid controllers (or SOS) to keep the metric count
|
||||||
# down (egregious errors will get logged by the proxy server itself).
|
# down (egregious errors will get logged by the proxy server itself).
|
||||||
|
@ -172,7 +172,7 @@ class Ring(object):
|
|||||||
self._part_shift = ring_data._part_shift
|
self._part_shift = ring_data._part_shift
|
||||||
self._rebuild_tier_data()
|
self._rebuild_tier_data()
|
||||||
|
|
||||||
# Do this now, when we know the data has changed, rather then
|
# Do this now, when we know the data has changed, rather than
|
||||||
# doing it on every call to get_more_nodes().
|
# doing it on every call to get_more_nodes().
|
||||||
regions = set()
|
regions = set()
|
||||||
zones = set()
|
zones = set()
|
||||||
|
@ -953,7 +953,7 @@ class Request(object):
|
|||||||
:param rest_with_last: If True, trailing data will be returned as part
|
:param rest_with_last: If True, trailing data will be returned as part
|
||||||
of last segment. If False, and there is
|
of last segment. If False, and there is
|
||||||
trailing data, raises ValueError.
|
trailing data, raises ValueError.
|
||||||
:returns: list of segments with a length of maxsegs (non-existant
|
:returns: list of segments with a length of maxsegs (non-existent
|
||||||
segments will return as None)
|
segments will return as None)
|
||||||
:raises: ValueError if given an invalid path
|
:raises: ValueError if given an invalid path
|
||||||
"""
|
"""
|
||||||
|
@ -630,7 +630,7 @@ def split_path(path, minsegs=1, maxsegs=None, rest_with_last=False):
|
|||||||
:param rest_with_last: If True, trailing data will be returned as part
|
:param rest_with_last: If True, trailing data will be returned as part
|
||||||
of last segment. If False, and there is
|
of last segment. If False, and there is
|
||||||
trailing data, raises ValueError.
|
trailing data, raises ValueError.
|
||||||
:returns: list of segments with a length of maxsegs (non-existant
|
:returns: list of segments with a length of maxsegs (non-existent
|
||||||
segments will return as None)
|
segments will return as None)
|
||||||
:raises: ValueError if given an invalid path
|
:raises: ValueError if given an invalid path
|
||||||
"""
|
"""
|
||||||
|
@ -52,7 +52,7 @@ class ContainerBroker(DatabaseBroker):
|
|||||||
|
|
||||||
def create_object_table(self, conn):
|
def create_object_table(self, conn):
|
||||||
"""
|
"""
|
||||||
Create the object table which is specifc to the container DB.
|
Create the object table which is specific to the container DB.
|
||||||
Not a part of Pluggable Back-ends, internal to the baseline code.
|
Not a part of Pluggable Back-ends, internal to the baseline code.
|
||||||
|
|
||||||
:param conn: DB connection object
|
:param conn: DB connection object
|
||||||
|
@ -26,7 +26,7 @@ classes. An example alternative implementation can be found in the
|
|||||||
The `DiskFileManager` is a reference implemenation specific class and is not
|
The `DiskFileManager` is a reference implemenation specific class and is not
|
||||||
part of the backend API.
|
part of the backend API.
|
||||||
|
|
||||||
The remaining methods in this module are considered implementation specifc and
|
The remaining methods in this module are considered implementation specific and
|
||||||
are also not considered part of the backend API.
|
are also not considered part of the backend API.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class TestReplicatorFunctions(TestCase):
|
|||||||
Class for testing replicators and replication servers.
|
Class for testing replicators and replication servers.
|
||||||
|
|
||||||
By default configuration - replication servers not used.
|
By default configuration - replication servers not used.
|
||||||
For testing separete replication servers servers need to change
|
For testing separate replication servers servers need to change
|
||||||
ring's files using set_info command or new ring's files with
|
ring's files using set_info command or new ring's files with
|
||||||
different port values.
|
different port values.
|
||||||
"""
|
"""
|
||||||
|
@ -312,7 +312,7 @@ class TestConstraintsConfig(unittest.TestCase):
|
|||||||
# file is now deleted...
|
# file is now deleted...
|
||||||
with mock.patch.object(utils, 'SWIFT_CONF_FILE', f.name):
|
with mock.patch.object(utils, 'SWIFT_CONF_FILE', f.name):
|
||||||
constraints.reload_constraints()
|
constraints.reload_constraints()
|
||||||
# no constraints have been loaded from non-existant swift.conf
|
# no constraints have been loaded from non-existent swift.conf
|
||||||
self.assertFalse(constraints.SWIFT_CONSTRAINTS_LOADED)
|
self.assertFalse(constraints.SWIFT_CONSTRAINTS_LOADED)
|
||||||
# no constraints are in OVERRIDE
|
# no constraints are in OVERRIDE
|
||||||
self.assertEquals([], constraints.OVERRIDE_CONSTRAINTS.keys())
|
self.assertEquals([], constraints.OVERRIDE_CONSTRAINTS.keys())
|
||||||
|
@ -1030,7 +1030,7 @@ class TestServer(unittest.TestCase):
|
|||||||
manager.WARNING_WAIT = 0.01
|
manager.WARNING_WAIT = 0.01
|
||||||
manager.time = MockTime()
|
manager.time = MockTime()
|
||||||
with open(os.path.join(t, 'output'), 'w+') as f:
|
with open(os.path.join(t, 'output'), 'w+') as f:
|
||||||
# acctually capture the read stdout (for prints)
|
# actually capture the read stdout (for prints)
|
||||||
sys.stdout = f
|
sys.stdout = f
|
||||||
# test closing pipe in subprocess unblocks read
|
# test closing pipe in subprocess unblocks read
|
||||||
with MockProcess() as proc:
|
with MockProcess() as proc:
|
||||||
|
@ -386,7 +386,7 @@ class TestRequest(unittest.TestCase):
|
|||||||
else:
|
else:
|
||||||
self.assert_(False, "invalid req_environ_property "
|
self.assert_(False, "invalid req_environ_property "
|
||||||
"didn't raise error!")
|
"didn't raise error!")
|
||||||
# non-existant attribute
|
# non-existent attribute
|
||||||
try:
|
try:
|
||||||
swift.common.swob.Request.blank('/', params_cache={'a': 'b'})
|
swift.common.swob.Request.blank('/', params_cache={'a': 'b'})
|
||||||
except TypeError as e:
|
except TypeError as e:
|
||||||
|
@ -1062,7 +1062,7 @@ def premetadata_create_container_stat_table(self, conn, put_timestamp=None):
|
|||||||
Copied from ContainerBroker before the metadata column was
|
Copied from ContainerBroker before the metadata column was
|
||||||
added; used for testing with TestContainerBrokerBeforeMetadata.
|
added; used for testing with TestContainerBrokerBeforeMetadata.
|
||||||
|
|
||||||
Create the container_stat table which is specifc to the container DB.
|
Create the container_stat table which is specific to the container DB.
|
||||||
|
|
||||||
:param conn: DB connection object
|
:param conn: DB connection object
|
||||||
:param put_timestamp: put timestamp
|
:param put_timestamp: put timestamp
|
||||||
@ -1135,7 +1135,7 @@ def prexsync_create_container_stat_table(self, conn, put_timestamp=None):
|
|||||||
x_container_sync_point[12] columns were added; used for testing with
|
x_container_sync_point[12] columns were added; used for testing with
|
||||||
TestContainerBrokerBeforeXSync.
|
TestContainerBrokerBeforeXSync.
|
||||||
|
|
||||||
Create the container_stat table which is specifc to the container DB.
|
Create the container_stat table which is specific to the container DB.
|
||||||
|
|
||||||
:param conn: DB connection object
|
:param conn: DB connection object
|
||||||
:param put_timestamp: put timestamp
|
:param put_timestamp: put timestamp
|
||||||
|
@ -40,7 +40,7 @@ class TestReceiver(unittest.TestCase):
|
|||||||
utils.HASH_PATH_SUFFIX = 'endcap'
|
utils.HASH_PATH_SUFFIX = 'endcap'
|
||||||
utils.HASH_PATH_PREFIX = 'startcap'
|
utils.HASH_PATH_PREFIX = 'startcap'
|
||||||
# Not sure why the test.unit stuff isn't taking effect here; so I'm
|
# Not sure why the test.unit stuff isn't taking effect here; so I'm
|
||||||
# reenforcing it.
|
# reinforcing it.
|
||||||
diskfile.getxattr = unit._getxattr
|
diskfile.getxattr = unit._getxattr
|
||||||
diskfile.setxattr = unit._setxattr
|
diskfile.setxattr = unit._setxattr
|
||||||
self.testdir = os.path.join(
|
self.testdir = os.path.join(
|
||||||
|
@ -4232,17 +4232,17 @@ class TestContainerController(unittest.TestCase):
|
|||||||
# return 200 and cache 200 for and container
|
# return 200 and cache 200 for and container
|
||||||
test_status_map((200, 200, 404, 404), 200, 200, 200)
|
test_status_map((200, 200, 404, 404), 200, 200, 200)
|
||||||
test_status_map((200, 200, 500, 404), 200, 200, 200)
|
test_status_map((200, 200, 500, 404), 200, 200, 200)
|
||||||
# return 304 dont cache container
|
# return 304 don't cache container
|
||||||
test_status_map((200, 304, 500, 404), 304, None, 200)
|
test_status_map((200, 304, 500, 404), 304, None, 200)
|
||||||
# return 404 and cache 404 for container
|
# return 404 and cache 404 for container
|
||||||
test_status_map((200, 404, 404, 404), 404, 404, 200)
|
test_status_map((200, 404, 404, 404), 404, 404, 200)
|
||||||
test_status_map((200, 404, 404, 500), 404, 404, 200)
|
test_status_map((200, 404, 404, 500), 404, 404, 200)
|
||||||
# return 503, dont cache container
|
# return 503, don't cache container
|
||||||
test_status_map((200, 500, 500, 500), 503, None, 200)
|
test_status_map((200, 500, 500, 500), 503, None, 200)
|
||||||
self.assertFalse(self.app.account_autocreate)
|
self.assertFalse(self.app.account_autocreate)
|
||||||
|
|
||||||
# In all the following tests cache 404 for account
|
# In all the following tests cache 404 for account
|
||||||
# return 404 (as account is not found) and dont cache container
|
# return 404 (as account is not found) and don't cache container
|
||||||
test_status_map((404, 404, 404), 404, None, 404)
|
test_status_map((404, 404, 404), 404, None, 404)
|
||||||
# This should make no difference
|
# This should make no difference
|
||||||
self.app.account_autocreate = True
|
self.app.account_autocreate = True
|
||||||
@ -5072,7 +5072,7 @@ class TestContainerController(unittest.TestCase):
|
|||||||
|
|
||||||
req = Request.blank('/v1/a/c', method='PUT', headers={'': ''})
|
req = Request.blank('/v1/a/c', method='PUT', headers={'': ''})
|
||||||
with save_globals():
|
with save_globals():
|
||||||
new_connect = set_http_connect(200, # account existance check
|
new_connect = set_http_connect(200, # account existence check
|
||||||
201, 201, 201,
|
201, 201, 201,
|
||||||
give_connect=capture_timestamps)
|
give_connect=capture_timestamps)
|
||||||
resp = self.app.handle_request(req)
|
resp = self.app.handle_request(req)
|
||||||
@ -5081,7 +5081,7 @@ class TestContainerController(unittest.TestCase):
|
|||||||
self.assertRaises(StopIteration, new_connect.code_iter.next)
|
self.assertRaises(StopIteration, new_connect.code_iter.next)
|
||||||
self.assertEqual(2, resp.status_int // 100)
|
self.assertEqual(2, resp.status_int // 100)
|
||||||
|
|
||||||
timestamps.pop(0) # account existance check
|
timestamps.pop(0) # account existence check
|
||||||
self.assertEqual(3, len(timestamps))
|
self.assertEqual(3, len(timestamps))
|
||||||
for timestamp in timestamps:
|
for timestamp in timestamps:
|
||||||
self.assertEqual(timestamp, timestamps[0])
|
self.assertEqual(timestamp, timestamps[0])
|
||||||
@ -5097,7 +5097,7 @@ class TestContainerController(unittest.TestCase):
|
|||||||
req = Request.blank('/v1/a/c', method='DELETE', headers={'': ''})
|
req = Request.blank('/v1/a/c', method='DELETE', headers={'': ''})
|
||||||
self.app.update_request(req)
|
self.app.update_request(req)
|
||||||
with save_globals():
|
with save_globals():
|
||||||
new_connect = set_http_connect(200, # account existance check
|
new_connect = set_http_connect(200, # account existence check
|
||||||
201, 201, 201,
|
201, 201, 201,
|
||||||
give_connect=capture_timestamps)
|
give_connect=capture_timestamps)
|
||||||
resp = self.app.handle_request(req)
|
resp = self.app.handle_request(req)
|
||||||
@ -5106,7 +5106,7 @@ class TestContainerController(unittest.TestCase):
|
|||||||
self.assertRaises(StopIteration, new_connect.code_iter.next)
|
self.assertRaises(StopIteration, new_connect.code_iter.next)
|
||||||
self.assertEqual(2, resp.status_int // 100)
|
self.assertEqual(2, resp.status_int // 100)
|
||||||
|
|
||||||
timestamps.pop(0) # account existance check
|
timestamps.pop(0) # account existence check
|
||||||
self.assertEqual(3, len(timestamps))
|
self.assertEqual(3, len(timestamps))
|
||||||
for timestamp in timestamps:
|
for timestamp in timestamps:
|
||||||
self.assertEqual(timestamp, timestamps[0])
|
self.assertEqual(timestamp, timestamps[0])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user