Merge ~newell-jensen/maas:lp1651165 into maas:master

Proposed by Newell Jensen
Status: Merged
Approved by: Newell Jensen
Approved revision: ca6ca099da16f1abcde33c135aac4e24bee67e99
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~newell-jensen/maas:lp1651165
Merge into: maas:master
Diff against target: 64 lines (+9/-11)
2 files modified
src/maasserver/static/js/angular/controllers/node_details_storage.js (+3/-5)
src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js (+6/-6)
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Andres Rodriguez (community) Needs Information
Review via email: mp+326957@code.launchpad.net

Commit message

Update the disk when editing the disk in the UI and not only the filesystem. This saves a new disk name if that was changed. Code for any filesystem updates is still in tact via the machine websocket handler update_disk method.

To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) :
review: Needs Information
Revision history for this message
Newell Jensen (newell-jensen) wrote :

What information is needed?

Revision history for this message
Andres Rodriguez (andreserl) :
Revision history for this message
Newell Jensen (newell-jensen) wrote :

Reply inline.

Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/static/js/angular/controllers/node_details_storage.js b/src/maasserver/static/js/angular/controllers/node_details_storage.js
2index f9efa04..31e32cd 100644
3--- a/src/maasserver/static/js/angular/controllers/node_details_storage.js
4+++ b/src/maasserver/static/js/angular/controllers/node_details_storage.js
5@@ -1,4 +1,4 @@
6-/* Copyright 2015-2016 Canonical Ltd. This software is licensed under the
7+/* Copyright 2015-2017 Canonical Ltd. This software is licensed under the
8 * GNU Affero General Public License version 3 (see the file LICENSE).
9 *
10 * MAAS Node Storage Controller
11@@ -1094,10 +1094,8 @@ angular.module('MAAS').controller('NodeStorageController', [
12 }
13
14 // Save the options.
15- MachinesManager.updateFilesystem(
16- $scope.node, disk.block_id, disk.partition_id,
17- disk.$options.fstype, disk.$options.mountPoint,
18- disk.$options.mountOptions, disk.$options.tags);
19+ MachinesManager.updateDisk(
20+ $scope.node, disk.block_id, params);
21
22 // Set the options on the object so no flicker occurs while waiting
23 // for the new object to be received.
24diff --git a/src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js b/src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js
25index a3e2045..9d7223a 100644
26--- a/src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js
27+++ b/src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js
28@@ -1,4 +1,4 @@
29-/* Copyright 2015-2016 Canonical Ltd. This software is licensed under the
30+/* Copyright 2015-2017 Canonical Ltd. This software is licensed under the
31 * GNU Affero General Public License version 3 (see the file LICENSE).
32 *
33 * Unit tests for NodeStorageController.
34@@ -3048,14 +3048,14 @@ describe("NodeStorageController", function() {
35 name: name
36 }
37 };
38- spyOn(MachinesManager, "updateFilesystem");
39+ spyOn(MachinesManager, "updateDisk");
40
41 $scope.availableConfirmEdit(disk);
42 expect(disk.name).toBe(name);
43- expect(MachinesManager.updateFilesystem).toHaveBeenCalled();
44+ expect(MachinesManager.updateDisk).toHaveBeenCalled();
45 });
46
47- it("calls updateDisks with new name for logical volume", function() {
48+ it("calls updateDisk with new name for logical volume", function() {
49 var controller = makeController();
50 var disk = {
51 name: "vg0-lvnew",
52@@ -3072,10 +3072,10 @@ describe("NodeStorageController", function() {
53 name: "vg0-lvold"
54 }
55 };
56- spyOn(MachinesManager, "updateFilesystem");
57+ spyOn(MachinesManager, "updateDisk");
58
59 $scope.availableConfirmEdit(disk);
60- expect(MachinesManager.updateFilesystem).toHaveBeenCalled();
61+ expect(MachinesManager.updateDisk).toHaveBeenCalled();
62 });
63
64 });

Subscribers

People subscribed via source and target branches