Add docstrings for cmd/agent and extensions/clean

Adding documentation for methods in these files that were missing
docstrings.

Change-Id: I2ad9f85605720ab2295dec3d0436ff0af07847c2
Partial-bug: 1367915
This commit is contained in:
Jay Faulkner
2015-09-03 16:15:54 -07:00
parent bc98593416
commit ac040f5152
2 changed files with 15 additions and 1 deletions

View File

@@ -105,6 +105,7 @@ CONF.register_cli_opts(cli_opts)
def run():
"""Entrypoint for IronicPythonAgent."""
log.register_options(CONF)
CONF(args=sys.argv[1:])
log.setup(CONF, 'ironic-python-agent')

View File

@@ -85,7 +85,15 @@ class CleanExtension(base.BaseAgentExtension):
def _check_clean_version(clean_version=None):
"""Ensure the clean version hasn't changed."""
"""Ensure the clean version hasn't changed.
:param clean_version: Hardware manager versions used during this
cleaning cycle.
:raises: errors.CleanVersionMismatch if any hardware manager version on
the currently running agent doesn't match the one stored in
clean_version.
:returns: None
"""
# If the version is None, assume this is the first run
if clean_version is None:
return
@@ -99,6 +107,11 @@ def _check_clean_version(clean_version=None):
def _get_current_clean_version():
"""Fetches versions from all hardware managers.
:returns: Dict in the format {name: version} containing one entry for
every hardware manager.
"""
return {version.get('name'): version.get('version')
for version in hardware.dispatch_to_all_managers(
'get_version').values()}