Merge ~adam-collard/maas:factory-no-nodedevice-by-default into maas:master

Proposed by Adam Collard
Status: Work in progress
Proposed branch: ~adam-collard/maas:factory-no-nodedevice-by-default
Merge into: maas:master
Diff against target: 33 lines (+5/-3)
1 file modified
src/maasserver/testing/factory.py (+5/-3)
Reviewer Review Type Date Requested Status
MAAS Lander Approve
Alberto Donato Approve
Review via email: mp+405464@code.launchpad.net

Commit message

Don't create node_devices by default in make_Node()

To post a comment you must log in.
Revision history for this message
Alberto Donato (ack) wrote :

+1 with a nit inline

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b factory-no-nodedevice-by-default lp:~adam-collard/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas/job/branch-tester/10486/console
COMMIT: 09da182222b9f107e1747031fcd800b79aa7b59b

review: Needs Fixing
Revision history for this message
Adam Collard (adam-collard) wrote :

jenkins: !test

Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b factory-no-nodedevice-by-default lp:~adam-collard/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas/job/branch-tester/10501/console
COMMIT: 09da182222b9f107e1747031fcd800b79aa7b59b

review: Needs Fixing
Revision history for this message
Adam Collard (adam-collard) wrote :

jenkins: !test

Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b factory-no-nodedevice-by-default lp:~adam-collard/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 09da182222b9f107e1747031fcd800b79aa7b59b

review: Approve

Unmerged commits

09da182... by Adam Collard

Don't create node_devices by default in make_Node()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/testing/factory.py b/src/maasserver/testing/factory.py
2index 1049b7a..21ecbbe 100644
3--- a/src/maasserver/testing/factory.py
4+++ b/src/maasserver/testing/factory.py
5@@ -417,6 +417,7 @@ class Factory(maastesting.factory.Factory):
6 with_empty_script_sets=False,
7 bmc=None,
8 ephemeral_deploy=False,
9+ with_node_devices=False,
10 **kwargs,
11 ):
12 """Make a :class:`Node`.
13@@ -589,8 +590,9 @@ class Factory(maastesting.factory.Factory):
14 Node.objects.filter(id=node.id).update(updated=updated)
15 if created is not None:
16 Node.objects.filter(id=node.id).update(created=created)
17- for _ in range(0, random.randint(10, 20)):
18- self.make_NodeDevice(node=node)
19+ if with_node_devices:
20+ for _ in range(random.randint(10, 20)):
21+ self.make_NodeDevice(node=node)
22 return reload_object(node)
23
24 def make_Machine(self, *args, **kwargs):
25@@ -627,7 +629,7 @@ class Factory(maastesting.factory.Factory):
26 def make_BMC(
27 self, power_type=None, power_parameters=None, ip_address=None, **kwargs
28 ):
29- """Make a :class:`BMC`. """
30+ """Make a :class:`BMC`."""
31 # If an IP address was specified, we need to present it in the BMC
32 # power_parameters, or it will be overwritten.
33 if ip_address is not None:

Subscribers

People subscribed via source and target branches