Merge ~steverydz/maas:1830133-undefined-logs into maas:master

Proposed by Steve Rydz
Status: Merged
Approved by: Steve Rydz
Approved revision: d2776465ecc645c2ec27a03a09b70d09e77e7fa8
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~steverydz/maas:1830133-undefined-logs
Merge into: maas:master
Diff against target: 66 lines (+5/-8)
4 files modified
src/maasserver/static/js/angular/controllers/node_details.js (+3/-4)
src/maasserver/static/js/angular/controllers/node_results.js (+0/-1)
src/maasserver/static/js/angular/directives/code_lines.js (+2/-2)
src/maasserver/static/partials/node-details.html (+0/-1)
Reviewer Review Type Date Requested Status
Caleb Ellis (community) Approve
Blake Rouse (community) Approve
Review via email: mp+367840@code.launchpad.net

Commit message

LP: #1830133 - Fix broken logs

Description of the change

Done:
- Fix some minor eslint issues
- Added a guard against undefined VLAN
- Fixed logs showing as undefined

QA:
- Go to a machine detail page and click the logs (this needs to be a machine with logs)
- See that the logs show information rather than just a list of the string "undefined"

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good.

review: Approve
Revision history for this message
Caleb Ellis (caleb-ellis) wrote :

LGTM +1

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

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

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.js b/src/maasserver/static/js/angular/controllers/node_details.js
2index 1c9833b..d8cc6ba 100644
3--- a/src/maasserver/static/js/angular/controllers/node_details.js
4+++ b/src/maasserver/static/js/angular/controllers/node_details.js
5@@ -152,6 +152,7 @@ function NodeDetailsController(
6 if (
7 !$scope.hideHighAvailabilityNotification &&
8 $scope.node.dhcp_on &&
9+ $scope.vlan &&
10 $scope.vlan.rack_sids.length > 1 &&
11 !$scope.vlan.secondary_rack &&
12 $scope.node.node_type !== NodeTypes.REGION_CONTROLLER
13@@ -161,12 +162,10 @@ function NodeDetailsController(
14 $scope.section.area === "vlans"
15 ) {
16 return true;
17- } else {
18- return false;
19 }
20- } else {
21- return false;
22 }
23+
24+ return false;
25 };
26
27 // Get the display text for device ip assignment type.
28diff --git a/src/maasserver/static/js/angular/controllers/node_results.js b/src/maasserver/static/js/angular/controllers/node_results.js
29index 6ebccb9..2b98c99 100644
30--- a/src/maasserver/static/js/angular/controllers/node_results.js
31+++ b/src/maasserver/static/js/angular/controllers/node_results.js
32@@ -40,7 +40,6 @@ function NodeResultsController(
33
34 function updateLogs() {
35 var i;
36- var option;
37 var had_installation = $scope.logs.availableOptions.length === 3;
38 $scope.logs.availableOptions.length = 0;
39 // XXX ltrager 2017-12-01 - Only show the current installation log
40diff --git a/src/maasserver/static/js/angular/directives/code_lines.js b/src/maasserver/static/js/angular/directives/code_lines.js
41index 1c78b1f..43265a9 100644
42--- a/src/maasserver/static/js/angular/directives/code_lines.js
43+++ b/src/maasserver/static/js/angular/directives/code_lines.js
44@@ -29,8 +29,8 @@ function maasCodeLines() {
45
46 // Each line is to be wrapped by a span which is style & given
47 // its appropriate line number
48- angular.forEach(lines, function() {
49- insert += newLine + '<span class="code-line">' + this + "</span>";
50+ angular.forEach(lines, function(line) {
51+ insert += newLine + '<span class="code-line">' + line + "</span>";
52 newLine = "\n";
53 });
54 insert += "</code>";
55diff --git a/src/maasserver/static/partials/node-details.html b/src/maasserver/static/partials/node-details.html
56index be59e3d..7d4e436 100755
57--- a/src/maasserver/static/partials/node-details.html
58+++ b/src/maasserver/static/partials/node-details.html
59@@ -3160,7 +3160,6 @@
60 No logs found.
61 </p>
62 </div>
63-
64 </div>
65 </div>
66 </div>

Subscribers

People subscribed via source and target branches