Skip to content

Commit 8bad5bb

Browse files
committed
Fix Sphinx Autodoc WARNING/ERROR in docs build
The docstrings here were all giving WARNINGs or ERRORs during the docs build, and were generally making unappealing looking developer documentation. I corrected the syntax and did what was neccessary to make the build come out clean. Change-Id: I74b00a7f125770b0468cff3bdf26d0d52cd054d7 (cherry picked from commit c0921cd)
1 parent be97525 commit 8bad5bb

File tree

4 files changed

+48
-38
lines changed

4 files changed

+48
-38
lines changed

ironic_python_agent/api/controllers/v1/base.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# All Rights Reserved.
22
#
3-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4-
# not use this file except in compliance with the License. You may obtain
5-
# a copy of the License at
3+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
4+
# not use this file except in compliance with the License. You may obtain
5+
# a copy of the License at
66
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
7+
# http://www.apache.org/licenses/LICENSE-2.0
88
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12-
# License for the specific language governing permissions and limitations
13-
# under the License.
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12+
# License for the specific language governing permissions and limitations
13+
# under the License.
1414

1515
import six
1616
from wsme import types as wtypes
@@ -45,7 +45,7 @@ class MultiType(wtypes.UserType):
4545
4646
Used for validating that a value is an instance of one of the types.
4747
48-
:param *types: Variable-length list of types.
48+
:param \*types: Variable-length list of types.
4949
5050
"""
5151
def __init__(self, *types):

ironic_python_agent/backoff.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,20 @@ class BackOffLoopingCall(loopingcall.LoopingCallBase):
6060
6161
:param initial_delay: delay before first running of function
6262
:param starting_interval: initial interval in seconds between calls to
63-
function. When an error occurs and then a success, the interval is
64-
returned to starting_interval
65-
:param timeout: time in seconds before a LoopingCallTimeout is raised
66-
The call will never take longer than timeout, but may quit before timeout
63+
function. When an error occurs and then a
64+
success, the interval is returned to
65+
starting_interval
66+
:param timeout: time in seconds before a LoopingCallTimeout is raised.
67+
The call will never take longer than timeout, but may quit
68+
before timeout.
6769
:param max_interval: The maximum interval between calls during errors
6870
:param jitter: Used to vary when calls are actually run to avoid group of
69-
calls all coming at the exact same time. Uses random.gauss(jitter,
70-
0.1), with jitter as the mean for the distribution. If set below .5,
71-
it can cause the calls to come more rapidly after each failure.
71+
calls all coming at the exact same time. Uses
72+
random.gauss(jitter, 0.1), with jitter as the mean for the
73+
distribution. If set below .5, it can cause the calls to
74+
come more rapidly after each failure.
7275
:raises: LoopingCallTimeout if time spent doing error retries would exceed
73-
timeout.
76+
timeout.
7477
"""
7578

7679
def start(self, initial_delay=None, starting_interval=1, timeout=300,

ironic_python_agent/extensions/clean.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ def get_clean_steps(self, node, ports):
4040
@base.async_command('execute_clean_step')
4141
def execute_clean_step(self, step, node, ports, clean_version=None,
4242
**kwargs):
43-
"""Execute a clean step
43+
"""Execute a clean step.
44+
4445
:param step: A clean step with 'step', 'priority' and 'interface' keys
4546
:param node: A dict representation of a node
4647
:param ports: A dict representation of ports attached to node
4748
:param clean_version: The clean version as returned by
48-
_get_current_clean_version() at the beginning of cleaning/zapping
49+
_get_current_clean_version() at the beginning
50+
of cleaning/zapping
4951
:returns: a CommandResult object with command_result set to whatever
5052
the step returns.
5153
"""

ironic_python_agent/hardware.py

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -163,30 +163,35 @@ def list_hardware_info(self):
163163
def get_clean_steps(self, node, ports):
164164
"""Get a list of clean steps with priority.
165165
166-
Returns a list of dicts of the following form:
167-
{'step': the HardwareManager function to call.
168-
'priority': the order steps will be run in. Ironic will sort all the
169-
clean steps from all the drivers, with the largest priority
170-
step being run first. If priority is set to 0, the step will
171-
not be run during cleaning, but may be run during zapping.
172-
'reboot_requested': Whether the agent should request Ironic reboots
173-
the node via the power driver after the operation completes.
174-
}
175-
176-
Note: multiple hardware managers may return the same step name. The
177-
priority of the step will be the largest priority of steps with
178-
the same name. The steps will be called using
179-
`hardware.dispatch_to_managers` and handled by the best suited
180-
hardware manager. If you need a step to be executed by only your
181-
hardware manager, ensure it has a unique step name.
166+
Returns a list of steps. Each step is represeted by a dict::
167+
168+
{
169+
'step': the HardwareManager function to call.
170+
'priority': the order steps will be run in. Ironic will sort all
171+
the clean steps from all the drivers, with the largest
172+
priority step being run first. If priority is set to 0,
173+
the step will not be run during cleaning, but may be
174+
run during zapping.
175+
'reboot_requested': Whether the agent should request Ironic reboots
176+
the node via the power driver after the
177+
operation completes.
178+
}
179+
180+
If multiple hardware managers return the same step name, the priority
181+
of the step will be the largest priority of steps with the same name.
182+
The steps will be called using `hardware.dispatch_to_managers` and
183+
handled by the best suited hardware manager. If you need a step to be
184+
executed by only your hardware manager, ensure it has a unique step
185+
name.
182186
183187
`node` and `ports` can be used by other hardware managers to further
184188
determine if a clean step is supported for the node.
185189
186190
:param node: Ironic node object
187191
:param ports: list of Ironic port objects
188-
:return: a default list of decommission steps, as a list of
189-
dictionaries
192+
:return: a list of cleaning steps, where each step is described as a
193+
dict as defined above
194+
190195
"""
191196
return [
192197
{

0 commit comments

Comments
 (0)