launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #13119
[Merge] lp:~allenap/maas/make-docutils-happy into lp:maas
Gavin Panella has proposed merging lp:~allenap/maas/make-docutils-happy into lp:maas.
Commit message:
Ensure that API docs are rendered without warnings or errors from docutils.
Previously no sanity checking of docstrings was performed. However, they need to be valid reStructuredText.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~allenap/maas/make-docutils-happy/+merge/128473
--
https://code.launchpad.net/~allenap/maas/make-docutils-happy/+merge/128473
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~allenap/maas/make-docutils-happy into lp:maas.
=== modified file 'src/maasserver/api.py'
--- src/maasserver/api.py 2012-10-08 10:42:37 +0000
+++ src/maasserver/api.py 2012-10-08 11:50:26 +0000
@@ -1187,6 +1187,7 @@
"""Return specific hardware_details for each node specified.
For security purposes we do:
+
a) Requests are only fulfilled for the worker assigned to the
nodegroup.
b) Requests for nodes that are not part of the nodegroup are just
=== modified file 'src/maasserver/tests/test_api.py'
--- src/maasserver/tests/test_api.py 2012-10-08 11:18:19 +0000
+++ src/maasserver/tests/test_api.py 2012-10-08 11:50:26 +0000
@@ -18,6 +18,7 @@
)
from base64 import b64encode
from collections import namedtuple
+from cStringIO import StringIO
from datetime import (
datetime,
timedelta,
@@ -29,6 +30,7 @@
import os
import random
import shutil
+import sys
from apiclient.maas_client import MAASClient
from celery.app import app_or_default
@@ -975,9 +977,11 @@
def test_anon_api_doc(self):
# The documentation is accessible to anon users.
+ self.patch(sys, "stderr", StringIO())
response = self.client.get(self.get_uri('doc/'))
-
self.assertEqual(httplib.OK, response.status_code)
+ # No error or warning are emitted by docutils.
+ self.assertEqual("", sys.stderr.getvalue())
def test_node_init_user_cannot_access(self):
token = NodeKey.objects.get_token_for_node(factory.make_node())