Skip to content

Commit

Permalink
Prevent line break in machine ipmi command. (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 authored Oct 11, 2023
1 parent f3acb33 commit 4adbaa4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/machine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ func Test_MachineIPMICmd_MultiResult(t *testing.T) {
},
wantTable: pointer.Pointer(`
ID POWER IP MAC BOARD PART NUMBER BIOS BMC SIZE PARTITION RACK UPDATED
1 ● (16.0W) 1.2.3.4 1.2.3.4 part123 2.0 1.1 1 1 rack-1 5s ago
1 ●  (16.0W) 1.2.3.4 1.2.3.4 part123 2.0 1.1 1 1 rack-1 5s ago
`),
wantWideTable: pointer.Pointer(`
ID STATUS POWER IP MAC BOARD PART NUMBER CHASSIS SERIAL PRODUCT SERIAL BIOS VERSION BMC VERSION SIZE PARTITION RACK UPDATED
Expand All @@ -472,7 +472,7 @@ ID STATUS POWER IP MAC BOARD PART NUMBER CHASSIS SERIAL
wantMarkdown: pointer.Pointer(`
| ID | | POWER | IP | MAC | BOARD PART NUMBER | BIOS | BMC | SIZE | PARTITION | RACK | UPDATED |
|----|--|------------|---------|---------|-------------------|------|-----|------|-----------|--------|---------|
| 1 | | ● (16.0W) | 1.2.3.4 | 1.2.3.4 | part123 | 2.0 | 1.1 | 1 | 1 | rack-1 | 5s ago |
| 1 | | ●  (16.0W) | 1.2.3.4 | 1.2.3.4 | part123 | 2.0 | 1.1 | 1 | 1 | rack-1 | 5s ago |
`),
},
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/tableprinters/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ func (t *TablePrinter) MachineIPMITable(data []*models.V1MachineIPMIResponse, wi
}
}

t.t.MutateTable(func(table *tablewriter.Table) {
table.SetAutoWrapText(false)
})

return header, rows, nil
}

Expand Down

0 comments on commit 4adbaa4

Please sign in to comment.