Merge lp:~julian-edwards/maas/enlist-nodegroup-bug-1274926 into lp:~maas-committers/maas/trunk

Proposed by Julian Edwards
Status: Merged
Approved by: Julian Edwards
Approved revision: no longer in the source branch.
Merged at revision: 1928
Proposed branch: lp:~julian-edwards/maas/enlist-nodegroup-bug-1274926
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 304 lines (+62/-0)
3 files modified
src/maasserver/api.py (+12/-0)
src/maasserver/tests/test_api_enlistment.py (+47/-0)
src/maasserver/tests/test_api_nodes.py (+3/-0)
To merge this branch: bzr merge lp:~julian-edwards/maas/enlist-nodegroup-bug-1274926
Reviewer Review Type Date Requested Status
Jeroen T. Vermeulen (community) Approve
Review via email: mp+205681@code.launchpad.net

Commit message

Add a new parameter for node enlisting called "autodetect_nodegroup", which will avoid an error being returned if the nodegroup is not manually specified. Previously, non-node API users calling this would cause the nodegroup detection to be based on the caller's IP, which is wrong.

To post a comment you must log in.
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Sensible change. I assume autodetection itself is already tested, in a test that needed no change. One thing that's a bit awkward (and I do see the XXX about it) is that the semantics of the autodetect_nodegroup parameter are only explained in the test. I think the representation of booleans is not very highly standardised, so it may be worth a note in the docstring even if the docstring does not cover all parameters.

For the error message in api.py, saying that the nodegroup parameter is missing may be too strong. There's a choice to be made. How about "one of nodegroup or autodetect_nodegroup must be specified"?

review: Approve
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Thanks for reviewing.

On Tuesday 11 Feb 2014 07:00:06 you wrote:
> Review: Approve
>
> Sensible change. I assume autodetection itself is already tested, in a test
> that needed no change. One thing that's a bit awkward (and I do see the
> XXX about it) is that the semantics of the autodetect_nodegroup parameter
> are only explained in the test. I think the representation of booleans is
> not very highly standardised, so it may be worth a note in the docstring
> even if the docstring does not cover all parameters.

I considered it but it felt daft to add just that one param and none of the
others, which is why I XXXed it for later! I'll stick it in the comment for
later inclusion in a decent docstring.

> For the error message in api.py, saying that the nodegroup parameter is
> missing may be too strong. There's a choice to be made. How about "one of
> nodegroup or autodetect_nodegroup must be specified"?

The code doesn't enforce that though, it just enforces the former without the
latter.

I'll land this now and we can discuss a different message later, I gotta run.

Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (25.7 KiB)

The attempt to merge lp:~julian-edwards/maas/enlist-nodegroup-bug-1274926 into lp:maas failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com trusty-security InRelease
Hit http://security.ubuntu.com trusty-security Release.gpg
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Hit http://security.ubuntu.com trusty-security Release
Ign http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Get:1 http://nova.clouds.archive.ubuntu.com trusty Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com trusty-updates Release.gpg
Get:2 http://nova.clouds.archive.ubuntu.com trusty Release [58.5 kB]
Hit http://security.ubuntu.com trusty-security/main Sources
Hit http://nova.clouds.archive.ubuntu.com trusty-updates Release
Hit http://security.ubuntu.com trusty-security/universe Sources
Hit http://security.ubuntu.com trusty-security/main amd64 Packages
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Get:3 http://nova.clouds.archive.ubuntu.com trusty/main Sources [1,057 kB]
Ign http://security.ubuntu.com trusty-security/main Translation-en_US
Ign http://security.ubuntu.com trusty-security/universe Translation-en_US
Get:4 http://nova.clouds.archive.ubuntu.com trusty/universe Sources [6,414 kB]
Get:5 http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages [1,315 kB]
Get:6 http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages [5,878 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en_US
Fetched 14.7 MB in 5s (2,680 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 bind9 bind9utils build-essential curl daemontools distro-info dnsutils firefox freeipmi-tools ipython isc-dhcp-common libjs-raphael libjs-yui3-full libjs-yui3-min libpq-dev make postgresql python-amqplib python-bzrlib python-celery python-convoy python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-formencode python-httplib2 python-jinja2 python-jsonschema python-lockfile python-lxml python-netaddr python-netifaces python-oauth python-oops py...

Revision history for this message
Julian Edwards (julian-edwards) wrote :

So it looks like tests for creating new nodes on the api are split between
test_api_enlistment.py and test_api_nodes.py.

:/

Revision history for this message
Raphaël Badin (rvb) wrote :

As discussed this morning, this change means earlier versions of maas-enlist will fail to register nodes (because the API call will not contain the 'autodetect_nodegroup' parameter). This means we won't be able to enlist/commission nodes using pre-Trusty series. In conjunction with bug 1279310, this restricts the number of series that can be used for enlistment down to zero :). (Note that we have a manual workaround (see the bug description)).

Revision history for this message
Jorge Niedbalski (niedbalski) wrote :

Hello guys,

Any way to workaround this ( using maasclient api) with pre-trusty versions?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/maasserver/api.py'
--- src/maasserver/api.py 2014-02-11 08:23:05 +0000
+++ src/maasserver/api.py 2014-02-11 23:37:14 +0000
@@ -514,6 +514,13 @@
514 # If 'nodegroup' is not explicitely specified, get the origin of the514 # If 'nodegroup' is not explicitely specified, get the origin of the
515 # request to figure out which nodegroup the new node should be515 # request to figure out which nodegroup the new node should be
516 # attached to.516 # attached to.
517 if request.data.get('autodetect_nodegroup', None) is None:
518 # We insist on this to protect command-line API users who
519 # are manually enlisting nodes. You can't use the origin's
520 # IP address to indicate in which nodegroup the new node belongs.
521 raise ValidationError(
522 "'autodetect_nodegroup' must be specified if 'nodegroup' "
523 "parameter missing")
517 nodegroup = find_nodegroup(request)524 nodegroup = find_nodegroup(request)
518 if nodegroup is not None:525 if nodegroup is not None:
519 altered_query_data['nodegroup'] = nodegroup526 altered_query_data['nodegroup'] = nodegroup
@@ -550,6 +557,11 @@
550 the enlistment is done by a non-admin, the node is held in the557 the enlistment is done by a non-admin, the node is held in the
551 "Declared" state for approval by a MAAS admin.558 "Declared" state for approval by a MAAS admin.
552 """559 """
560 # XXX 2014-02-11 bug=1278685
561 # There's no documentation here on what parameters can be passed!
562
563 # Note that request.autodetect_nodegroup is treated as a
564 # boolean; its presence indicates True.
553 return create_node(request)565 return create_node(request)
554566
555 @operation(idempotent=True)567 @operation(idempotent=True)
556568
=== modified file 'src/maasserver/tests/test_api_enlistment.py'
--- src/maasserver/tests/test_api_enlistment.py 2014-02-01 04:04:37 +0000
+++ src/maasserver/tests/test_api_enlistment.py 2014-02-11 23:37:14 +0000
@@ -54,6 +54,7 @@
54 reverse('nodes_handler'),54 reverse('nodes_handler'),
55 {55 {
56 'op': 'new',56 'op': 'new',
57 'autodetect_nodegroup': '1',
57 'hostname': 'diane',58 'hostname': 'diane',
58 'architecture': architecture,59 'architecture': architecture,
59 'power_type': 'ether_wake',60 'power_type': 'ether_wake',
@@ -76,6 +77,7 @@
76 reverse('nodes_handler'),77 reverse('nodes_handler'),
77 {78 {
78 'op': 'new',79 'op': 'new',
80 'autodetect_nodegroup': '1',
79 'hostname': hostname,81 'hostname': hostname,
80 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),82 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
81 'power_type': 'ether_wake',83 'power_type': 'ether_wake',
@@ -105,6 +107,7 @@
105 reverse('nodes_handler'),107 reverse('nodes_handler'),
106 {108 {
107 'op': 'new',109 'op': 'new',
110 'autodetect_nodegroup': '1',
108 'hostname': hostname,111 'hostname': hostname,
109 'architecture': architecture,112 'architecture': architecture,
110 'power_type': 'ether_wake',113 'power_type': 'ether_wake',
@@ -125,6 +128,7 @@
125 reverse('nodes_handler'),128 reverse('nodes_handler'),
126 {129 {
127 'op': 'new',130 'op': 'new',
131 'autodetect_nodegroup': '1',
128 'hostname': 'diane',132 'hostname': 'diane',
129 'architecture': architecture.split('/')[0],133 'architecture': architecture.split('/')[0],
130 'power_type': 'ether_wake',134 'power_type': 'ether_wake',
@@ -148,6 +152,7 @@
148 reverse('nodes_handler'),152 reverse('nodes_handler'),
149 {153 {
150 'op': 'new',154 'op': 'new',
155 'autodetect_nodegroup': '1',
151 'hostname': 'diane',156 'hostname': 'diane',
152 'architecture': architecture.split('/')[0],157 'architecture': architecture.split('/')[0],
153 'subarchitecture': architecture.split('/')[1],158 'subarchitecture': architecture.split('/')[1],
@@ -171,6 +176,7 @@
171 reverse('nodes_handler'),176 reverse('nodes_handler'),
172 {177 {
173 'op': 'new',178 'op': 'new',
179 'autodetect_nodegroup': '1',
174 'hostname': 'diane',180 'hostname': 'diane',
175 'architecture': architecture,181 'architecture': architecture,
176 'subarchitecture': architecture.split('/')[1],182 'subarchitecture': architecture.split('/')[1],
@@ -192,6 +198,7 @@
192 reverse('nodes_handler'),198 reverse('nodes_handler'),
193 {199 {
194 'op': 'new',200 'op': 'new',
201 'autodetect_nodegroup': '1',
195 'hostname': 'diane',202 'hostname': 'diane',
196 'architecture': architecture,203 'architecture': architecture,
197 'after_commissioning_action': (204 'after_commissioning_action': (
@@ -209,6 +216,7 @@
209 reverse('nodes_handler'),216 reverse('nodes_handler'),
210 {217 {
211 'op': 'new',218 'op': 'new',
219 'autodetect_nodegroup': '1',
212 'hostname': hostname,220 'hostname': hostname,
213 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),221 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
214 'mac_addresses': [factory.getRandomMACAddress()],222 'mac_addresses': [factory.getRandomMACAddress()],
@@ -223,6 +231,7 @@
223 reverse('nodes_handler'),231 reverse('nodes_handler'),
224 {232 {
225 'op': 'new',233 'op': 'new',
234 'autodetect_nodegroup': '1',
226 'architecture': architecture,235 'architecture': architecture,
227 'power_type': 'ether_wake',236 'power_type': 'ether_wake',
228 'mac_addresses': [factory.getRandomMACAddress()],237 'mac_addresses': [factory.getRandomMACAddress()],
@@ -247,6 +256,26 @@
247 "Unrecognised signature: POST None",256 "Unrecognised signature: POST None",
248 response.content)257 response.content)
249258
259 def test_POST_new_fails_if_autodetect_nodegroup_required(self):
260 # If new() is called with no nodegroup, we require the client to
261 # explicitly also supply autodetect_nodegroup (with any value)
262 # to force the autodetection. If it's not supplied then an error
263 # is raised.
264 architecture = factory.getRandomChoice(ARCHITECTURE_CHOICES)
265 response = self.client.post(
266 reverse('nodes_handler'),
267 {
268 'op': 'new',
269 'architecture': architecture,
270 'power_type': 'ether_wake',
271 'mac_addresses': [factory.getRandomMACAddress()],
272 })
273 self.assertEqual(httplib.BAD_REQUEST, response.status_code)
274 self.assertIn('text/plain', response['Content-Type'])
275 self.assertEqual(
276 "'autodetect_nodegroup' must be specified if 'nodegroup' "
277 "parameter missing", response.content)
278
250 def test_POST_fails_if_mac_duplicated(self):279 def test_POST_fails_if_mac_duplicated(self):
251 # Mac Addresses should be unique.280 # Mac Addresses should be unique.
252 mac = 'aa:bb:cc:dd:ee:ff'281 mac = 'aa:bb:cc:dd:ee:ff'
@@ -256,6 +285,7 @@
256 reverse('nodes_handler'),285 reverse('nodes_handler'),
257 {286 {
258 'op': 'new',287 'op': 'new',
288 'autodetect_nodegroup': '1',
259 'architecture': architecture,289 'architecture': architecture,
260 'hostname': factory.getRandomString(),290 'hostname': factory.getRandomString(),
261 'mac_addresses': [mac],291 'mac_addresses': [mac],
@@ -275,6 +305,7 @@
275 reverse('nodes_handler'),305 reverse('nodes_handler'),
276 {306 {
277 'op': 'invalid_operation',307 'op': 'invalid_operation',
308 'autodetect_nodegroup': '1',
278 'hostname': 'diane',309 'hostname': 'diane',
279 'mac_addresses': ['aa:bb:cc:dd:ee:ff', 'invalid'],310 'mac_addresses': ['aa:bb:cc:dd:ee:ff', 'invalid'],
280 })311 })
@@ -291,6 +322,7 @@
291 reverse('nodes_handler'),322 reverse('nodes_handler'),
292 {323 {
293 'op': 'new',324 'op': 'new',
325 'autodetect_nodegroup': '1',
294 'hostname': 'diane',326 'hostname': 'diane',
295 'mac_addresses': ['aa:bb:cc:dd:ee:ff', 'invalid'],327 'mac_addresses': ['aa:bb:cc:dd:ee:ff', 'invalid'],
296 })328 })
@@ -309,6 +341,7 @@
309 reverse('nodes_handler'),341 reverse('nodes_handler'),
310 {342 {
311 'op': 'new',343 'op': 'new',
344 'autodetect_nodegroup': '1',
312 'hostname': 'diane',345 'hostname': 'diane',
313 'mac_addresses': ['aa:bb:cc:dd:ee:ff'],346 'mac_addresses': ['aa:bb:cc:dd:ee:ff'],
314 'architecture': 'invalid-architecture',347 'architecture': 'invalid-architecture',
@@ -342,6 +375,7 @@
342 reverse('nodes_handler'),375 reverse('nodes_handler'),
343 {376 {
344 'op': 'new',377 'op': 'new',
378 'autodetect_nodegroup': '1',
345 'hostname': hostname_with_domain,379 'hostname': hostname_with_domain,
346 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),380 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
347 'power_type': 'ether_wake',381 'power_type': 'ether_wake',
@@ -366,6 +400,7 @@
366 reverse('nodes_handler'),400 reverse('nodes_handler'),
367 {401 {
368 'op': 'new',402 'op': 'new',
403 'autodetect_nodegroup': '1',
369 'hostname': hostname_without_domain,404 'hostname': hostname_without_domain,
370 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),405 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
371 'power_type': 'ether_wake',406 'power_type': 'ether_wake',
@@ -388,6 +423,7 @@
388 reverse('nodes_handler'),423 reverse('nodes_handler'),
389 data={424 data={
390 'op': 'new',425 'op': 'new',
426 'autodetect_nodegroup': '1',
391 'hostname': factory.make_name('hostname'),427 'hostname': factory.make_name('hostname'),
392 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),428 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
393 'power_type': 'ether_wake',429 'power_type': 'ether_wake',
@@ -407,6 +443,7 @@
407 reverse('nodes_handler'),443 reverse('nodes_handler'),
408 data={444 data={
409 'op': 'new',445 'op': 'new',
446 'autodetect_nodegroup': '1',
410 'hostname': factory.make_name('hostname'),447 'hostname': factory.make_name('hostname'),
411 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),448 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
412 'power_type': 'ether_wake',449 'power_type': 'ether_wake',
@@ -438,6 +475,7 @@
438 reverse('nodes_handler'),475 reverse('nodes_handler'),
439 {476 {
440 'op': 'new',477 'op': 'new',
478 'autodetect_nodegroup': '1',
441 'hostname': factory.getRandomString(),479 'hostname': factory.getRandomString(),
442 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),480 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
443 'after_commissioning_action': (481 'after_commissioning_action': (
@@ -470,6 +508,7 @@
470 reverse('nodes_handler'),508 reverse('nodes_handler'),
471 {509 {
472 'op': 'new',510 'op': 'new',
511 'autodetect_nodegroup': '1',
473 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),512 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
474 'hostname': factory.getRandomString(),513 'hostname': factory.getRandomString(),
475 'after_commissioning_action': (514 'after_commissioning_action': (
@@ -535,6 +574,7 @@
535 response = self.client.post(574 response = self.client.post(
536 reverse('nodes_handler'), {575 reverse('nodes_handler'), {
537 'op': 'new',576 'op': 'new',
577 'autodetect_nodegroup': '1',
538 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),578 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
539 'power_type': 'ether_wake',579 'power_type': 'ether_wake',
540 'power_parameters': json.dumps(580 'power_parameters': json.dumps(
@@ -556,6 +596,7 @@
556 reverse('nodes_handler'),596 reverse('nodes_handler'),
557 {597 {
558 'op': 'new',598 'op': 'new',
599 'autodetect_nodegroup': '1',
559 'hostname': factory.getRandomString(),600 'hostname': factory.getRandomString(),
560 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),601 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
561 'after_commissioning_action': (602 'after_commissioning_action': (
@@ -592,6 +633,7 @@
592 response = self.client.post(633 response = self.client.post(
593 reverse('nodes_handler'), {634 reverse('nodes_handler'), {
594 'op': 'new',635 'op': 'new',
636 'autodetect_nodegroup': '1',
595 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),637 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
596 'power_type': 'ether_wake',638 'power_type': 'ether_wake',
597 'mac_addresses': ['00:11:22:33:44:55'],639 'mac_addresses': ['00:11:22:33:44:55'],
@@ -609,6 +651,7 @@
609 response = self.client.post(651 response = self.client.post(
610 reverse('nodes_handler'), {652 reverse('nodes_handler'), {
611 'op': 'new',653 'op': 'new',
654 'autodetect_nodegroup': '1',
612 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),655 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
613 'power_type': 'ether_wake',656 'power_type': 'ether_wake',
614 'power_parameters_mac_address': new_mac_address,657 'power_parameters_mac_address': new_mac_address,
@@ -628,6 +671,7 @@
628 response = self.client.post(671 response = self.client.post(
629 reverse('nodes_handler'), {672 reverse('nodes_handler'), {
630 'op': 'new',673 'op': 'new',
674 'autodetect_nodegroup': '1',
631 'hostname': hostname,675 'hostname': hostname,
632 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),676 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
633 'power_type': 'ether_wake',677 'power_type': 'ether_wake',
@@ -651,6 +695,7 @@
651 response = self.client.post(695 response = self.client.post(
652 reverse('nodes_handler'), {696 reverse('nodes_handler'), {
653 'op': 'new',697 'op': 'new',
698 'autodetect_nodegroup': '1',
654 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),699 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
655 'power_type': 'ether_wake',700 'power_type': 'ether_wake',
656 'power_parameters_param': param,701 'power_parameters_param': param,
@@ -673,6 +718,7 @@
673 reverse('nodes_handler'),718 reverse('nodes_handler'),
674 {719 {
675 'op': 'new',720 'op': 'new',
721 'autodetect_nodegroup': '1',
676 'hostname': factory.getRandomString(),722 'hostname': factory.getRandomString(),
677 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),723 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
678 'power_type': 'ether_wake',724 'power_type': 'ether_wake',
@@ -692,6 +738,7 @@
692 reverse('nodes_handler'),738 reverse('nodes_handler'),
693 {739 {
694 'op': 'new',740 'op': 'new',
741 'autodetect_nodegroup': '1',
695 'hostname': factory.getRandomString(),742 'hostname': factory.getRandomString(),
696 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),743 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
697 'power_type': 'ether_wake',744 'power_type': 'ether_wake',
698745
=== modified file 'src/maasserver/tests/test_api_nodes.py'
--- src/maasserver/tests/test_api_nodes.py 2014-02-10 11:34:47 +0000
+++ src/maasserver/tests/test_api_nodes.py 2014-02-11 23:37:14 +0000
@@ -152,6 +152,7 @@
152 reverse('nodes_handler'),152 reverse('nodes_handler'),
153 {153 {
154 'op': 'new',154 'op': 'new',
155 'autodetect_nodegroup': '1',
155 'hostname': factory.getRandomString(),156 'hostname': factory.getRandomString(),
156 'architecture': architecture,157 'architecture': architecture,
157 'after_commissioning_action': (158 'after_commissioning_action': (
@@ -168,6 +169,7 @@
168 reverse('nodes_handler'),169 reverse('nodes_handler'),
169 {170 {
170 'op': 'new',171 'op': 'new',
172 'autodetect_nodegroup': '1',
171 'hostname': factory.getRandomString(),173 'hostname': factory.getRandomString(),
172 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),174 'architecture': factory.getRandomChoice(ARCHITECTURE_CHOICES),
173 'after_commissioning_action': (175 'after_commissioning_action': (
@@ -1085,6 +1087,7 @@
1085 '/api/1.0/nodes/MAAS/api/1.0/nodes/',1087 '/api/1.0/nodes/MAAS/api/1.0/nodes/',
1086 {1088 {
1087 'op': 'new',1089 'op': 'new',
1090 'autodetect_nodegroup': '1',
1088 'hostname': factory.getRandomString(),1091 'hostname': factory.getRandomString(),
1089 'architecture': architecture,1092 'architecture': architecture,
1090 'mac_addresses': ['aa:bb:cc:dd:ee:ff'],1093 'mac_addresses': ['aa:bb:cc:dd:ee:ff'],