Bug 1482477 - Null values are not handled correctly when dumping data to file with tripleo-ansible-inventory
Summary: Null values are not handled correctly when dumping data to file with tripleo-...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-validations
Version: 12.0 (Pike)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: beta
: 12.0 (Pike)
Assignee: Florian Fuchs
QA Contact: Honza Pokorny
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-17 11:26 UTC by Yurii Prokulevych
Modified: 2018-02-05 19:12 UTC (History)
10 users (show)

Fixed In Version: openstack-tripleo-validations-7.3.1-0.20170831052729.67faa39.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-13 21:53:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1701239 0 None None None 2017-10-03 14:06:39 UTC
OpenStack gerrit 495965 0 None None None 2017-10-03 14:09:15 UTC
Red Hat Product Errata RHEA-2017:3462 0 normal SHIPPED_LIVE Red Hat OpenStack Platform 12.0 Enhancement Advisory 2018-02-16 01:43:25 UTC

Description Yurii Prokulevych 2017-08-17 11:26:49 UTC
Description of problem:
-----------------------
Null values are not handled correctly, which leads to just key being dumped to the inventory file.

E.g: 
/usr/bin/tripleo-ansible-inventory --static-inventory oc-hosts
ansible -i oc-hosts Controllers -m ping -vv
Using /etc/ansible/ansible.cfg as config file
ERROR! Attempted to read "oc-hosts" as YAML: Syntax Error while loading YAML.

The error appears to have been in '/home/stack/oc-hosts': line 1, column 16, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

[aodh_evaluator:vars]
               ^ here

Attempted to read "oc-hosts" as ini file: oc-hosts:366: Expected key=value, got: cacert

Offending line: 
===============
[undercloud:vars]
...
auth_url = http://192.168.24.1:5000/
ansible_connection = local
--->cacert
undercloud_swift_url = http://192.168.24.1:8080/v1/AUTH_f83abc228845445dbc8cea361ee276ff
plan = overcloud

And when passing output through 'python -m json.tool':
======================================================
/usr/bin/tripleo-ansible-inventory --list | python -m json.tool
...
    "undercloud": {
        "hosts": [
            "localhost"
        ],
        "vars": {
            "ansible_connection": "local",
            "auth_url": "http://192.168.24.1:5000/",
            "cacert": null,
            "undercloud_swift_url": "http://192.168.24.1:8080/v1/AUTH_f83abc228845445dbc8cea361ee276ff",
            "username": "admin"
        }
...

Version-Release number of selected component (if applicable):
-------------------------------------------------------------
openstack-tripleo-validations-7.2.1-0.20170807182119.1f60b6f.el7ost.noarch

How reproducible:
-----------------
So far 100%

Comment 2 Gaël Chamoulaud 2017-10-03 14:09:15 UTC
FYI, This issue was fixed in the openstack/tripleo-validations 7.3.0 upstream release [1].

[1] - https://review.openstack.org/#/c/495965/

Comment 3 Gaël Chamoulaud 2017-10-03 14:40:26 UTC
(In reply to Gaël Chamoulaud from comment #2)
> FYI, This issue was fixed in the openstack/tripleo-validations 7.3.0
> upstream release [1].
> 
> [1] - https://review.openstack.org/#/c/495965/

And this change was included into openstack-tripleo-validations-7.3.1-0.20170831052729.67faa39.el7ost build.

Comment 9 errata-xmlrpc 2017-12-13 21:53:35 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/RHEA-2017:3462


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