Bug 1805654

Summary: Ansible Inventory reports, print multiple blank line in the output
Product: Red Hat Satellite Reporter: Ranjan Kumar <rankumar>
Component: ReportingAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: low Docs Contact:
Priority: low    
Version: 6.7.0CC: ehelms, mhulan, oprazak
Target Milestone: 6.10.0Keywords: Triaged, UserExperience
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 14:09:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ranjan Kumar 2020-02-21 10:14:49 UTC
Description of problem:
Ansible Inventory reports, print multiple blank lines in the output

Version-Release number of selected component (if applicable): 6.7


How reproducible: Always

Output:
[root@satellite ~]# hammer report-template generate --name 'Ansible Inventory' --report-format json





[{"id":1,"name":"satellite.example.com","organization":"Redhat","location":"Pune","host_group":null,"host_collections":["hc","vvvv"],"ipv4":"192.168.122.2","subnet":null,"smart_proxies":["satellite.example.com"]},{"id":12,"name":"dell-r430-8.gsslab.rdu2.redhat.com","organization":"Redhat","location":"Pune","host_group":null,"host_collections":["hc","vvvv"],"ipv4":null,"subnet":null,"smart_proxies":["satellite.example.com"]},{"id":17,"name":"tower.example.com","organization":"Redhat","location":"Pune","host_group":"satellite","host_collections":["hc","vvvv"],"ipv4":"192.168.100.3","subnet":"example.com","smart_proxies":["satellite.example.com"]},{"id":21,"name":"capsule.example.com","organization":"Redhat","location":"Pune","host_group":"satellite","host_collections":["hc","vvvv"],"ipv4":null,"subnet":"example.com","smart_proxies":["satellite.example.com"]},{"id":31,"name":"xxxx.com-3","organization":"Redhat","location":"Default Location","host_group":null,"host_collections":["hc","vvvv"],"ipv4":null,"subnet":null,"smart_proxies":[]},{"id":34,"name":"rudy-liebe.example.com","organization":"Redhat","location":"Default Location","host_group":"satellite","host_collections":["hc","vvvv"],"ipv4":"192.168.100.26","subnet":"example.com","smart_proxies":["satellite.example.com"]},{"id":35,"name":"ansible-node1.example.com","organization":"Redhat","location":"Pune","host_group":"satellite","host_collections":["hc","vvvv"],"ipv4":"192.168.100.47","subnet":"example.com","smart_proxies":["satellite.example.com"]},{"id":36,"name":"ansible-master.example.com","organization":"Redhat","location":"Pune","host_group":"satellite","host_collections":["hc","vvvv"],"ipv4":"192.168.100.10","subnet":"example.com","smart_proxies":["satellite.example.com"]},{"id":41,"name":"darla-robideau.example.com","organization":"Redhat","location":"Pune","host_group":"satellite","host_collections":["hc","vvvv"],"ipv4":"192.168.122.40","subnet":"example.com","smart_proxies":["satellite.example.com"]},{"id":42,"name":"puppet.example.com","organization":"Redhat","location":"Pune","host_group":"satellite","host_collections":["hc","vvvv"],"ipv4":"192.168.122.18","subnet":"example.com","smart_proxies":["satellite.example.com"]}]

Expected:
It should not print blank lines in the output

Comment 3 Ondřej Pražák 2020-02-21 10:54:14 UTC
Created redmine issue https://projects.theforeman.org/issues/29111 from this bug

Comment 4 Anand Agrawal 2021-01-28 10:35:05 UTC
(In reply to Ondřej Pražák from comment #3)
> Created redmine issue https://projects.theforeman.org/issues/29111 from this
> bug

Can you pleas check the PR https://github.com/theforeman/foreman/pull/8289

Regards,
Anand

Comment 5 Ondrej 2021-01-28 10:47:59 UTC
wrong Ondrej

Comment 7 Bryan Kearney 2021-02-02 15:44:14 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/29111 has been resolved.

Comment 8 Lukáš Hellebrandt 2021-07-09 13:09:58 UTC
Verified with Sat 6.10.0 snap 5.0.

Report now doesn't contain bogus empty lines in {CSV,JSON}x{WebUI,Hammer}-generated reports:

# hammer report-template generate --name 'Ansible - Ansible Inventory' --report-format json
[{"id":1,"name":"<FQDN>","organization":"Default Organization","location":"Default Location","host_group":null,"host_collections":[],"ipv4":"<IP>","subnet":null,"smart_proxies":["<FQDN>"]},{"id":2,"name":"<FQDN>","organization":"Default Organization","location":"Default Location","host_group":null,"host_collections":[],"ipv4":"<IP>","subnet":null,"smart_proxies":["<FQDN>"]},{"id":3,"name":"<FQDN>","organization":"Default Organization","location":"Default Location","host_group":"testgrp","host_collections":[],"ipv4":"<IP>","subnet":null,"smart_proxies":["<FQDN>"]}]

Comment 12 errata-xmlrpc 2021-11-16 14:09:07 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 (Moderate: Satellite 6.10 Release), 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-2021:4702