Merge ~ltrager/maas:lp1788530 into maas:master

Proposed by Lee Trager
Status: Merged
Approved by: Lee Trager
Approved revision: c665f9e37a4064000844733ea0b3b95387198b53
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ltrager/maas:lp1788530
Merge into: maas:master
Diff against target: 14 lines (+2/-1)
1 file modified
src/maasserver/static/js/angular/controllers/node_details_storage.js (+2/-1)
Reviewer Review Type Date Requested Status
Mike Pontillo (community) Approve
MAAS Lander Approve
Kit Randel Pending
Review via email: mp+356792@code.launchpad.net

Commit message

LP: #1788530 - Only use maasForm size when defined.

Description of the change

I'm not sure this special case is still needed. This is happening because I first created a partition for the volume group to be on top of. $maasForm is defined but size is not. Would it be safer to remove this?

To post a comment you must log in.
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b lp1788530 lp:~ltrager/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: c665f9e37a4064000844733ea0b3b95387198b53

review: Approve
Revision history for this message
Mike Pontillo (mpontillo) wrote :

You'd have to test if it's safe to remove separately, but I think this added check is fine. Can't hurt to be defensive when working with Angular objects that might or might not exist.

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 67792d1..4959d80 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@@ -1240,7 +1240,8 @@ angular.module('MAAS').controller('NodeStorageController', [
6 let size = disk.$options.size;
7 // blr 2018-07-23: special cased as isAddLogicalVolumeSizeInvalid
8 // calls this but has not yet migrated to maas-obj-form.
9- if($scope.newPartition.$maasForm) {
10+ if($scope.newPartition.$maasForm &&
11+ $scope.newPartition.$maasForm.getValue('size')) {
12 size = $scope.newPartition.$maasForm.getValue('size');
13 }
14 if(size === "" || !isNumber(size)) {

Subscribers

People subscribed via source and target branches