Bug 1645275 - Output of "hammer organization list" Should Only Begin with an Organization ID
Summary: Output of "hammer organization list" Should Only Begin with an Organization ID
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Organizations and Locations
Version: 6.3.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: 6.7.0
Assignee: satellite6-bugs
QA Contact: Peter Dragun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-01 19:12 UTC by William Allison
Modified: 2020-04-14 13:23 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-14 13:23:25 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 25878 Normal Closed New lines in text attributes break the hammer output 2019-12-17 10:33:48 UTC
Red Hat Product Errata RHSA-2020:1454 None None None 2020-04-14 13:23:40 UTC

Description William Allison 2018-11-01 19:12:57 UTC
User-Agent:       Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
Build Identifier: 

The output of the following commands should only print the Organization ID, one per line, of all Organizations on the Satellite Server:

hammer organization list | grep -vE '\--|ID' | awk '{ print $1 }'
hammer --csv organization list | grep -vi '^id' | awk -F, '{ print $1 }'

However, if 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 Satellite Server as an admin user.
3. Run the commands included in this bug report.

Actual Results:  
The additional information from the Description field will be on a line by itself in the "ID" field.

Expected Results:  
Only numerical Organization IDs should be returned.

Additionally, there are two "Description" fields in the output of "hammer organization list".  This was observed on both Satellite versions 6.2.9 and 6.3.3.

Comment 2 Ondřej Pražák 2019-01-17 08:46:25 UTC
Created redmine issue http://projects.theforeman.org/issues/25878 from this bug

Comment 3 Bryan Kearney 2019-09-30 12:07:24 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25878 has been resolved.

Comment 4 Peter Dragun 2019-12-17 12:10:34 UTC
Verified on Satellite 6.7 snap 6.
New lines are now represented as white spaces. Also tried commands from comment 1. Output contains just IDs, each on its own line.

Comment 7 errata-xmlrpc 2020-04-14 13:23:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1454


Note You need to log in before you can comment on or make changes to this bug.