Merge lp:~ltrager/maas/fix_messages-1.9 into lp:maas/1.9

Proposed by Lee Trager
Status: Merged
Approved by: Lee Trager
Approved revision: no longer in the source branch.
Merged at revision: 4507
Proposed branch: lp:~ltrager/maas/fix_messages-1.9
Merge into: lp:maas/1.9
Diff against target: 57 lines (+17/-10)
2 files modified
src/maasserver/models/node.py (+9/-4)
src/maasserver/models/tests/test_node.py (+8/-6)
To merge this branch: bzr merge lp:~ltrager/maas/fix_messages-1.9
Reviewer Review Type Date Requested Status
Lee Trager (community) Approve
Review via email: mp+278233@code.launchpad.net

Commit message

Backport of 4513 from trunk: Clean up validate storage error messages.

Description of the change

Backport of 4513 from trunk: Clean up validate storage error messages

To post a comment you must log in.
Revision history for this message
Lee Trager (ltrager) wrote :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/models/node.py'
2--- src/maasserver/models/node.py 2015-11-18 18:14:30 +0000
3+++ src/maasserver/models/node.py 2015-11-21 02:18:14 +0000
4@@ -820,12 +820,17 @@
5 boot_mounted = True
6 issues = []
7 if not has_boot:
8- issues.append("Node must have boot disk.")
9+ issues.append(
10+ "Specify a storage device to be able to deploy this node.")
11 if not root_mounted:
12- issues.append("Node must have / mounted.")
13+ issues.append(
14+ "Mount the root '/' filesystem to be able to deploy this "
15+ "node.")
16 if root_mounted and root_on_bcache and not boot_mounted:
17- issues.append("Because / is on a bcache volume you must create "
18- "/boot on a non-bcache volume")
19+ issues.append(
20+ "This node cannot be deployed because it cannot boot from a "
21+ "bcache volume. Mount /boot on a non-bcache device to be "
22+ "able to deploy this node.")
23 return issues
24
25 def on_network(self):
26
27=== modified file 'src/maasserver/models/tests/test_node.py'
28--- src/maasserver/models/tests/test_node.py 2015-11-18 18:14:30 +0000
29+++ src/maasserver/models/tests/test_node.py 2015-11-21 02:18:14 +0000
30@@ -3799,9 +3799,10 @@
31
32 def test_storage_layout_issues_returns_invalid_when_no_disk(self):
33 node = factory.make_Node(with_boot_disk=False)
34- self.assertEquals(["Node must have boot disk.",
35- "Node must have / mounted."],
36- node.storage_layout_issues())
37+ self.assertEquals(
38+ ["Specify a storage device to be able to deploy this node.",
39+ "Mount the root '/' filesystem to be able to deploy this node."],
40+ node.storage_layout_issues())
41
42 def test_storage_layout_issues_returns_invalid_when_root_on_bcache(self):
43 node = factory.make_Node(with_boot_disk=False)
44@@ -3810,9 +3811,10 @@
45 node=node, group_type=FILESYSTEM_GROUP_TYPE.BCACHE)
46 bcache = fs_group.virtual_device
47 factory.make_Filesystem(block_device=bcache, mount_point="/")
48- self.assertEquals(["Because / is on a bcache volume you must create "
49- "/boot on a non-bcache volume"],
50- node.storage_layout_issues())
51+ self.assertEquals(
52+ ["This node cannot be deployed because it cannot boot from a "
53+ "bcache volume. Mount /boot on a non-bcache device to be able to "
54+ "deploy this node."], node.storage_layout_issues())
55
56
57 class TestNode_Stop(MAASServerTestCase):

Subscribers

People subscribed via source and target branches