Merge lp:~nobuto/maas/api-doc-fix into lp:~maas-committers/maas/trunk

Proposed by Nobuto Murata
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 5253
Proposed branch: lp:~nobuto/maas/api-doc-fix
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 132 lines (+19/-10)
5 files modified
src/maasserver/api/blockdevices.py (+2/-0)
src/maasserver/api/doc_handler.py (+1/-1)
src/maasserver/api/interfaces.py (+5/-0)
src/maasserver/api/machines.py (+9/-7)
src/maasserver/forms_settings.py (+2/-2)
To merge this branch: bzr merge lp:~nobuto/maas/api-doc-fix
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+303064@code.launchpad.net

Commit message

Fix rendering of api.html to preserve significant whitespace.

Previously significant newlines were being removed from some documentation sections, causing incorrect rendering.

Description of the change

To render api.html with consistent reST format. Please refer to the screenshots attached in LP: #1613857 and LP: #1613918.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

Good stuff, thank you!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/api/blockdevices.py'
2--- src/maasserver/api/blockdevices.py 2016-08-14 17:36:30 +0000
3+++ src/maasserver/api/blockdevices.py 2016-08-17 01:27:57 +0000
4@@ -228,6 +228,7 @@
5 """Update block device on a machine.
6
7 Fields for physical block device:
8+
9 :param name: Name of the block device.
10 :param model: Model of the block device.
11 :param serial: Serial number of the block device.
12@@ -238,6 +239,7 @@
13 :param block_size: Block size of the block device.
14
15 Fields for virtual block device:
16+
17 :param name: Name of the block device.
18 :param uuid: UUID of the block device.
19 :param size: Size of the block device. (Only allowed for logical \
20
21=== modified file 'src/maasserver/api/doc_handler.py'
22--- src/maasserver/api/doc_handler.py 2016-04-11 16:23:26 +0000
23+++ src/maasserver/api/doc_handler.py 2016-08-17 01:27:57 +0000
24@@ -138,7 +138,7 @@
25 for (http_method, op), function in sorted(exports, key=export_key):
26 line("``%s %s``" % (http_method, uri_template), end="")
27 if op is not None:
28- line(" ``op=%s``" % op)
29+ line(" ``op=%s``" % op, end="")
30 line()
31 docstring = getdoc(function)
32 if docstring is not None:
33
34=== modified file 'src/maasserver/api/interfaces.py'
35--- src/maasserver/api/interfaces.py 2016-08-15 09:46:22 +0000
36+++ src/maasserver/api/interfaces.py 2016-08-17 01:27:57 +0000
37@@ -379,6 +379,7 @@
38 """Update interface on node.
39
40 Fields for physical interface:
41+
42 :param name: Name of the interface.
43 :param mac_address: MAC address of the interface.
44 :param tags: Tags for the interface.
45@@ -386,6 +387,7 @@
46 then the interface is considered disconnected.
47
48 Fields for bond interface:
49+
50 :param name: Name of the interface.
51 :param mac_address: MAC address of the interface.
52 :param tags: Tags for the interface.
53@@ -394,11 +396,13 @@
54 :param parents: Parent interfaces that make this bond.
55
56 Fields for VLAN interface:
57+
58 :param tags: Tags for the interface.
59 :param vlan: Tagged VLAN the interface is connected to.
60 :param parent: Parent interface for this VLAN interface.
61
62 Fields for bridge interface:
63+
64 :param name: Name of the interface.
65 :param mac_address: MAC address of the interface.
66 :param tags: Tags for the interface.
67@@ -428,6 +432,7 @@
68 slave selection in balance-xor, 802.3ad, and tlb modes.
69
70 Supported bonding modes (bond-mode):
71+
72 balance-rr - Transmit packets in sequential order from the first
73 available slave through the last. This mode provides load balancing
74 and fault tolerance.
75
76=== modified file 'src/maasserver/api/machines.py'
77--- src/maasserver/api/machines.py 2016-08-15 09:46:22 +0000
78+++ src/maasserver/api/machines.py 2016-08-17 01:27:57 +0000
79@@ -1124,25 +1124,27 @@
80 nodes must have one or more interface matching the specified
81 constraints. The labeled constraint map must be in the format:
82 ``<label>:<key>=<value>[,<key2>=<value2>[,...]]``
83+
84 Each key can be one of the following:
85+
86 - id: Matches an interface with the specific id
87 - fabric: Matches an interface attached to the specified fabric.
88 - fabric_class: Matches an interface attached to a fabric
89- with the specified class.
90+ with the specified class.
91 - ip: Matches an interface with the specified IP address
92- assigned to it.
93+ assigned to it.
94 - mode: Matches an interface with the specified mode. (Currently,
95- the only supported mode is "unconfigured".)
96+ the only supported mode is "unconfigured".)
97 - name: Matches an interface with the specified name.
98- (For example, "eth0".)
99+ (For example, "eth0".)
100 - hostname: Matches an interface attached to the node with
101- the specified hostname.
102+ the specified hostname.
103 - subnet: Matches an interface attached to the specified subnet.
104 - space: Matches an interface attached to the specified space.
105 - subnet_cidr: Matches an interface attached to the specified
106- subnet CIDR. (For example, "192.168.0.0/24".)
107+ subnet CIDR. (For example, "192.168.0.0/24".)
108 - type: Matches an interface of the specified type. (Valid
109- types: "physical", "vlan", "bond", "bridge", or "unknown".)
110+ types: "physical", "vlan", "bond", "bridge", or "unknown".)
111 - vlan: Matches an interface on the specified VLAN.
112 - vid: Matches an interface on a VLAN with the specified VID.
113 - tag: Matches an interface tagged with the specified tag.
114
115=== modified file 'src/maasserver/forms_settings.py'
116--- src/maasserver/forms_settings.py 2016-07-30 01:17:54 +0000
117+++ src/maasserver/forms_settings.py 2016-08-17 01:27:57 +0000
118@@ -464,7 +464,7 @@
119 doc = ["Available configuration items:\n\n"]
120 for config_name, config_details in sorted(CONFIG_ITEMS.items()):
121 form_details = config_details['form_kwargs']
122- doc.append("- " + config_name + ": " + form_details['label'] + ". ")
123+ doc.append(":" + config_name + ": " + form_details['label'] + ". ")
124 # Append help text if present.
125 help_text = form_details.get('help_text')
126 if help_text is not None:
127@@ -476,4 +476,4 @@
128 doc.append("Available choices are: %s." % choice_descr)
129 doc.append("\n")
130 full_text = (' ' * indentation).join(doc)
131- return re.sub('\s+$', '', full_text, flags=re.MULTILINE)
132+ return re.sub('\ +$', '', full_text, flags=re.MULTILINE)