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:
@@ -105,6 +105,7 @@ CONF.register_cli_opts(cli_opts)
|
|||||||
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
|
"""Entrypoint for IronicPythonAgent."""
|
||||||
log.register_options(CONF)
|
log.register_options(CONF)
|
||||||
CONF(args=sys.argv[1:])
|
CONF(args=sys.argv[1:])
|
||||||
log.setup(CONF, 'ironic-python-agent')
|
log.setup(CONF, 'ironic-python-agent')
|
||||||
|
|||||||
@@ -85,7 +85,15 @@ class CleanExtension(base.BaseAgentExtension):
|
|||||||
|
|
||||||
|
|
||||||
def _check_clean_version(clean_version=None):
|
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 the version is None, assume this is the first run
|
||||||
if clean_version is None:
|
if clean_version is None:
|
||||||
return
|
return
|
||||||
@@ -99,6 +107,11 @@ def _check_clean_version(clean_version=None):
|
|||||||
|
|
||||||
|
|
||||||
def _get_current_clean_version():
|
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')
|
return {version.get('name'): version.get('version')
|
||||||
for version in hardware.dispatch_to_all_managers(
|
for version in hardware.dispatch_to_all_managers(
|
||||||
'get_version').values()}
|
'get_version').values()}
|
||||||
|
|||||||
Reference in New Issue
Block a user