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