← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jtv/maas/cluster-muck into lp:maas

 

Jeroen T. Vermeulen has proposed merging lp:~jtv/maas/cluster-muck into lp:maas.

Commit message:
Add trailing slash to API URL as used by start-cluster-controller.

Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~jtv/maas/cluster-muck/+merge/126302

See commit message.  Without this, Django won't accept these API calls.

(There was also a bit of drive-by lint).


Jeroen
-- 
https://code.launchpad.net/~jtv/maas/cluster-muck/+merge/126302
Your team MAAS Maintainers is requested to review the proposed merge of lp:~jtv/maas/cluster-muck into lp:maas.
=== modified file 'src/maasserver/tests/test_node.py'
--- src/maasserver/tests/test_node.py	2012-09-25 14:46:25 +0000
+++ src/maasserver/tests/test_node.py	2012-09-25 17:36:21 +0000
@@ -39,7 +39,10 @@
 from maasserver.testing import reload_object
 from maasserver.testing.factory import factory
 from maasserver.testing.testcase import TestCase
-from maasserver.utils import map_enum
+from maasserver.utils import (
+    ignore_unused,
+    map_enum,
+    )
 from metadataserver.models import (
     NodeCommissionResult,
     NodeUserData,
@@ -492,6 +495,7 @@
 
     def test_hardware_updates_tags_no_match(self):
         tag1 = factory.make_tag(factory.getRandomString(10), "/missing")
+        ignore_unused(tag1)
         tag2 = factory.make_tag(factory.getRandomString(10), "/nothing")
         node = factory.make_node()
         node.tags = [tag2]

=== modified file 'src/provisioningserver/start_cluster_controller.py'
--- src/provisioningserver/start_cluster_controller.py	2012-09-25 10:45:12 +0000
+++ src/provisioningserver/start_cluster_controller.py	2012-09-25 17:36:21 +0000
@@ -69,7 +69,7 @@
     known_responses = {httplib.OK, httplib.FORBIDDEN, httplib.ACCEPTED}
     client = make_anonymous_api_client(server_url)
     try:
-        response = client.post('api/1.0/nodegroups', 'register')
+        response = client.post('api/1.0/nodegroups/', 'register')
     except HTTPError as e:
         status_code = e.code
         if e.code not in known_responses:
@@ -126,7 +126,7 @@
 def request_refresh(server_url):
     client = make_anonymous_api_client(server_url)
     try:
-        client.post('api/1.0/nodegroups', 'refresh_workers')
+        client.post('api/1.0/nodegroups/', 'refresh_workers')
     except URLError as e:
         task_logger.warn(
             "Could not request secrets from region controller: %s"

=== modified file 'src/provisioningserver/tests/test_start_cluster_controller.py'
--- src/provisioningserver/tests/test_start_cluster_controller.py	2012-09-25 14:17:57 +0000
+++ src/provisioningserver/tests/test_start_cluster_controller.py	2012-09-25 17:36:21 +0000
@@ -117,7 +117,7 @@
         self.prepare_success_response()
         start_cluster_controller.run(FakeArgs(url))
         (args, kwargs) = MAASDispatcher.dispatch_query.call_args
-        self.assertEqual(url + 'api/1.0/nodegroups', args[0])
+        self.assertEqual(url + 'api/1.0/nodegroups/', args[0])
 
     def test_fails_if_declined(self):
         self.patch(start_cluster_controller, 'start_up')
@@ -162,7 +162,7 @@
         start_cluster_controller.start_up(url, connection_details)
 
         (args, kwargs) = MAASDispatcher.dispatch_query.call_args
-        self.assertEqual(url + 'api/1.0/nodegroups', args[0])
+        self.assertEqual(url + 'api/1.0/nodegroups/', args[0])
         self.assertEqual('POST', kwargs['method'])
 
         # Make Django STFU; just using Django's multipart code causes it to