Merge "Fixed inconsistencies in docstrings"
This commit is contained in:
commit
1ba56c64e9
@ -180,12 +180,12 @@ def check_object_creation(req, object_name):
|
||||
|
||||
:param req: HTTP request object
|
||||
:param object_name: name of object to be created
|
||||
:returns HTTPRequestEntityTooLarge: the object is too large
|
||||
:returns HTTPLengthRequired: missing content-length header and not
|
||||
a chunked request
|
||||
:returns HTTPBadRequest: missing or bad content-type header, or
|
||||
bad metadata
|
||||
:returns HTTPNotImplemented: unsupported transfer-encoding header value
|
||||
:returns: HTTPRequestEntityTooLarge -- the object is too large
|
||||
:returns: HTTPLengthRequired -- missing content-length header and not
|
||||
a chunked request
|
||||
:returns: HTTPBadRequest -- missing or bad content-type header, or
|
||||
bad metadata
|
||||
:returns: HTTPNotImplemented -- unsupported transfer-encoding header value
|
||||
"""
|
||||
try:
|
||||
ml = req.message_length()
|
||||
|
@ -153,8 +153,7 @@ class InternalClient(object):
|
||||
|
||||
def make_request(
|
||||
self, method, path, headers, acceptable_statuses, body_file=None):
|
||||
"""
|
||||
Makes a request to Swift with retries.
|
||||
"""Makes a request to Swift with retries.
|
||||
|
||||
:param method: HTTP method of request.
|
||||
:param path: Path of request.
|
||||
@ -163,7 +162,7 @@ class InternalClient(object):
|
||||
:param body_file: Body file to be passed along with request,
|
||||
defaults to None.
|
||||
|
||||
:returns : Response object on success.
|
||||
:returns: Response object on success.
|
||||
|
||||
:raises UnexpectedResponse: Exception raised when make_request() fails
|
||||
to get a response with an acceptable status
|
||||
@ -213,8 +212,8 @@ class InternalClient(object):
|
||||
defaults to (2,).
|
||||
:param headers: extra headers to send
|
||||
|
||||
:returns : A dict of metadata with metadata_prefix stripped from keys.
|
||||
Keys will be lowercase.
|
||||
:returns: A dict of metadata with metadata_prefix stripped from keys.
|
||||
Keys will be lowercase.
|
||||
|
||||
:raises UnexpectedResponse: Exception raised when requests fail
|
||||
to get a response with an acceptable status
|
||||
@ -367,8 +366,7 @@ class InternalClient(object):
|
||||
|
||||
def get_account_metadata(
|
||||
self, account, metadata_prefix='', acceptable_statuses=(2,)):
|
||||
"""
|
||||
Gets account metadata.
|
||||
"""Gets account metadata.
|
||||
|
||||
:param account: Account on which to get the metadata.
|
||||
:param metadata_prefix: Used to filter values from the headers
|
||||
@ -377,7 +375,7 @@ class InternalClient(object):
|
||||
:param acceptable_statuses: List of status for valid responses,
|
||||
defaults to (2,).
|
||||
|
||||
:returns : Returns dict of account metadata. Keys will be lowercase.
|
||||
:returns: Returns dict of account metadata. Keys will be lowercase.
|
||||
|
||||
:raises UnexpectedResponse: Exception raised when requests fail
|
||||
to get a response with an acceptable status
|
||||
@ -418,8 +416,7 @@ class InternalClient(object):
|
||||
# container methods
|
||||
|
||||
def container_exists(self, account, container):
|
||||
"""
|
||||
Checks to see if a container exists.
|
||||
"""Checks to see if a container exists.
|
||||
|
||||
:param account: The container's account.
|
||||
:param container: Container to check.
|
||||
@ -429,7 +426,7 @@ class InternalClient(object):
|
||||
:raises Exception: Exception is raised when code fails in an
|
||||
unexpected way.
|
||||
|
||||
:returns : True if container exists, false otherwise.
|
||||
:returns: True if container exists, false otherwise.
|
||||
"""
|
||||
|
||||
path = self.make_path(account, container)
|
||||
@ -479,8 +476,7 @@ class InternalClient(object):
|
||||
def get_container_metadata(
|
||||
self, account, container, metadata_prefix='',
|
||||
acceptable_statuses=(2,)):
|
||||
"""
|
||||
Gets container metadata.
|
||||
"""Gets container metadata.
|
||||
|
||||
:param account: The container's account.
|
||||
:param container: Container to get metadata on.
|
||||
@ -490,7 +486,7 @@ class InternalClient(object):
|
||||
:param acceptable_statuses: List of status for valid responses,
|
||||
defaults to (2,).
|
||||
|
||||
:returns : Returns dict of container metadata. Keys will be lowercase.
|
||||
:returns: Returns dict of container metadata. Keys will be lowercase.
|
||||
|
||||
:raises UnexpectedResponse: Exception raised when requests fail
|
||||
to get a response with an acceptable status
|
||||
@ -580,8 +576,7 @@ class InternalClient(object):
|
||||
def get_object_metadata(
|
||||
self, account, container, obj, metadata_prefix='',
|
||||
acceptable_statuses=(2,), headers=None):
|
||||
"""
|
||||
Gets object metadata.
|
||||
"""Gets object metadata.
|
||||
|
||||
:param account: The object's account.
|
||||
:param container: The object's container.
|
||||
@ -593,7 +588,7 @@ class InternalClient(object):
|
||||
defaults to (2,).
|
||||
:param headers: extra headers to send with request
|
||||
|
||||
:returns : Dict of object metadata.
|
||||
:returns: Dict of object metadata.
|
||||
|
||||
:raises UnexpectedResponse: Exception raised when requests fail
|
||||
to get a response with an acceptable status
|
||||
|
@ -645,7 +645,7 @@ class Server(object):
|
||||
:param wait: boolean, if true capture stdout with a pipe
|
||||
:param daemon: boolean, if false ask server to log to console
|
||||
|
||||
:returns : the pid of the spawned process
|
||||
:returns: the pid of the spawned process
|
||||
"""
|
||||
args = [self.cmd, conf_file]
|
||||
if once:
|
||||
|
@ -1874,15 +1874,14 @@ def capture_stdio(logger, **kwargs):
|
||||
|
||||
|
||||
def parse_options(parser=None, once=False, test_args=None):
|
||||
"""
|
||||
Parse standard swift server/daemon options with optparse.OptionParser.
|
||||
"""Parse standard swift server/daemon options with optparse.OptionParser.
|
||||
|
||||
:param parser: OptionParser to use. If not sent one will be created.
|
||||
:param once: Boolean indicating the "once" option is available
|
||||
:param test_args: Override sys.argv; used in testing
|
||||
|
||||
:returns : Tuple of (config, options); config is an absolute path to the
|
||||
config file, options is the parser options as a dictionary.
|
||||
:returns: Tuple of (config, options); config is an absolute path to the
|
||||
config file, options is the parser options as a dictionary.
|
||||
|
||||
:raises SystemExit: First arg (CONFIG) is required, file must exist
|
||||
"""
|
||||
|
@ -169,8 +169,8 @@ def get_socket(conf):
|
||||
|
||||
:param conf: Configuration dict to read settings from
|
||||
|
||||
:returns : a socket object as returned from socket.listen or
|
||||
ssl.wrap_socket if conf specifies cert_file
|
||||
:returns: a socket object as returned from socket.listen or
|
||||
ssl.wrap_socket if conf specifies cert_file
|
||||
"""
|
||||
try:
|
||||
bind_port = int(conf['bind_port'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user