From 4cb2ac4ae4db01efef8fd705b7ce8329475c7f92 Mon Sep 17 00:00:00 2001 From: Kaifeng Wang Date: Tue, 9 Apr 2019 10:24:17 +0800 Subject: [PATCH] Fix docs job failure due to malformated docstring Change-Id: Ic3532e51481fd07e2f816aeacb07ded2d56791ee --- ironic_python_agent/hardware.py | 8 ++-- ironic_python_agent/numa_inspector.py | 69 +++++++++++++++------------ ironic_python_agent/utils.py | 5 +- 3 files changed, 45 insertions(+), 37 deletions(-) diff --git a/ironic_python_agent/hardware.py b/ironic_python_agent/hardware.py index ca312fdb6..e615ca3b5 100644 --- a/ironic_python_agent/hardware.py +++ b/ironic_python_agent/hardware.py @@ -1215,8 +1215,8 @@ def dispatch_to_all_managers(method, *args, **kwargs): {HardwareManagerClassName: response}. :param method: hardware manager method to dispatch - :param *args: arguments to dispatched method - :param **kwargs: keyword arguments to dispatched method + :param args: arguments to dispatched method + :param kwargs: keyword arguments to dispatched method :raises errors.HardwareManagerMethodNotFound: if all managers raise IncompatibleHardwareMethodError. :returns: a dictionary with keys for each hardware manager that returns @@ -1259,8 +1259,8 @@ def dispatch_to_managers(method, *args, **kwargs): any result without raising an IncompatibleHardwareMethodError. :param method: hardware manager method to dispatch - :param *args: arguments to dispatched method - :param **kwargs: keyword arguments to dispatched method + :param args: arguments to dispatched method + :param kwargs: keyword arguments to dispatched method :returns: result of successful dispatch of method :raises HardwareManagerMethodNotFound: if all managers failed the method diff --git a/ironic_python_agent/numa_inspector.py b/ironic_python_agent/numa_inspector.py index f952ba30d..61e9028d8 100644 --- a/ironic_python_agent/numa_inspector.py +++ b/ironic_python_agent/numa_inspector.py @@ -49,7 +49,9 @@ def get_numa_node_id(numa_node_dir): def get_nodes_memory_info(numa_node_dirs): """Collect the NUMA nodes memory information. - "ram": [{"numa_node": , "size_kb": }, ...] + The information is returned in the form of:: + + "ram": [{"numa_node": , "size_kb": }, ...] :param numa_node_dirs: A list of NUMA node directories :raises: IncompatibleNumaFormatError: when unexpected format data @@ -96,13 +98,6 @@ def get_nodes_memory_info(numa_node_dirs): def get_nodes_cores_info(numa_node_dirs): """Collect the NUMA nodes cpu's and thread's information. - "cpus": [ - { - "cpu": , "numa_node": , - "thread_siblings": [] - }, - ..., - ] NUMA nodes path: /sys/devices/system/node/node Thread dirs path: /sys/devices/system/node/node/cpu @@ -110,6 +105,16 @@ def get_nodes_cores_info(numa_node_dirs): CPU id file path: /sys/devices/system/node/node/cpu/ topology/core_id + The information is returned in the form of:: + + "cpus": [ + { + "cpu": , "numa_node": , + "thread_siblings": [] + }, + ..., + ] + :param numa_node_dirs: A list of NUMA node directories :raises: IncompatibleNumaFormatError: when unexpected format data in NUMA node @@ -167,10 +172,13 @@ def get_nodes_cores_info(numa_node_dirs): def get_nodes_nics_info(nic_device_path): """Collect the NUMA nodes nics information. - "nics": [ - {"name": "", "numa_node": }, - ..., - ] + The information is returned in the form of:: + + "nics": [ + {"name": "", + "numa_node": }, + ..., + ] :param nic_device_path: nic device directory path :raises: IncompatibleNumaFormatError: when unexpected format data @@ -207,25 +215,26 @@ def get_nodes_nics_info(nic_device_path): def collect_numa_topology_info(data, failures): """Collect the NUMA topology information. - { - "numa_topology": { - "ram": [{"numa_node": , "size_kb": }, ...], - "cpus": [ - { - "cpu": , "numa_node": , - "thread_siblings": [] - }, - ..., - ], - "nics": [ - {"name": "", "numa_node": }, - ..., - ] - } - } - The data is gathered from /sys/devices/system/node/node and - /sys/class/net/ directories. + /sys/class/net/ directories. The information is collected in the form of:: + + { + "numa_topology": { + "ram": [{"numa_node": , "size_kb": }, + ...], + "cpus": [ + { + "cpu": , "numa_node": , + "thread_siblings": [] + }, + ..., + ], + "nics": [ + {"name": "", "numa_node": }, + ..., + ] + } + } :param data: mutable data that we'll send to inspector :param failures: AccumulatedFailures object diff --git a/ironic_python_agent/utils.py b/ironic_python_agent/utils.py index 4621ff8d7..0fa744a7e 100644 --- a/ironic_python_agent/utils.py +++ b/ironic_python_agent/utils.py @@ -76,9 +76,8 @@ def try_execute(*cmd, **kwargs): Instead of raising an exception on failure, this method simply returns None in case of failure. - :param *cmd: positional arguments to pass to processutils.execute() - :param log_stdout: keyword-only argument: whether to log the output - :param **kwargs: keyword arguments to pass to processutils.execute() + :param cmd: positional arguments to pass to processutils.execute() + :param kwargs: keyword arguments to pass to processutils.execute() :raises: UnknownArgumentError on receiving unknown arguments :returns: tuple of (stdout, stderr) or None in some error cases """