Bug #25878
New lines in text attributes break the hammer output
Description
When there are new lines in the text attributes, it affect how hammer displays individual rows. As a result, the following commands cannot be used to retrieve ids.
hammer organization list | grep -vE '\--|ID' | awk '{ print $1 }'
hammer --csv organization list | grep -vi '^id' | awk -F, '{ print $1 }'
Because there is a newline character in the "Description" field on the "Edit <Organization Name>" page available at Administer > Organizations > Primary, the text on the new line will show up in the "ID" field of the commands above.
Reproducible: Always
Steps to Reproduce:
1. Create an Organization with additional information on a new line in the Description field.
2. Login to the CLI of the Foreman server as an admin user.
3. Run the commands included in this bug report.
Additionally, there are two "Description" fields in the output of "hammer organization list".
Associated revisions
History
#1
Updated by Martin Bacovsky about 4 years ago
- Triaged changed from No to Yes
- Subject changed from New lines in text attributes break the hammer output to New lines in text attributes break the hammer output
#2
Updated by Oleh Fedorenko almost 4 years ago
- Assignee set to Oleh Fedorenko
- Status changed from New to Assigned
#3
Updated by The Foreman Bot almost 4 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/hammer-cli/pull/300 added
#4
Updated by The Foreman Bot almost 4 years ago
- Pull request https://github.com/theforeman/hammer-cli-foreman/pull/415 added
#5
Updated by Martin Bacovsky over 3 years ago
- Team Backlog Hammer added
#6
Updated by The Foreman Bot over 3 years ago
- Fixed in Releases hammer-cli-0.19.0 added
#7
Updated by Oleh Fedorenko over 3 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset a4dcbe7389efbcfdc9de7cbaecb91178eaa3e3ec.
Fixes #25878 - New lines in text attr dont break output (#300)