Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1805654 - Ansible Inventory reports, print multiple blank line in the output
Summary: Ansible Inventory reports, print multiple blank line in the output
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Reporting
Version: 6.7.0
Hardware: All
OS: All
low
low
Target Milestone: 6.10.0
Assignee: satellite6-bugs
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-21 10:14 UTC by Ranjan Kumar
Modified: 2021-11-16 14:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:09:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 29111 0 Low New Generating Ansible Inventory includes newlines in response 2021-01-28 10:11:52 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:09:18 UTC

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


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