dynamic inventory error needs better message

Bug #1635040 reported by Steve Lewis
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Confirmed
Wishlist
Pauline

Bug Description

Deploying master with service-specific conf.d files yielded the following error

 Traceback (most recent call last):
  File "inventory/dynamic_inventory.py", line 1304, in <module>
    output = main(**all_args)
  File "inventory/dynamic_inventory.py", line 1229, in main
    environment.get('container_skel')
  File "inventory/dynamic_inventory.py", line 1091, in _check_config_settings
    _check_same_ip_to_multiple_host(config)
  File "inventory/dynamic_inventory.py", line 1002, in _check_same_ip_to_multiple_host
    ip = _value['ip']
 KeyError: 'ip'

The fault was identified as a misplaced element in the yaml file, but we couldn't tell which file easily. Identifying the host with the missing ip, and the file containing the error was an exercise which could have been made easier by the dynamic inventory lib.

Praveen N (praveenn)
Changed in openstack-ansible:
assignee: nobody → Praveen N (praveenn)
Changed in openstack-ansible:
importance: Undecided → Wishlist
status: New → Confirmed
tags: added: low-hanging-fruit
Revision history for this message
Jesse Pretorius (jesse-pretorius) wrote :

It'd be great to have a sample set of configs to replicate the issue.

Revision history for this message
Nolan Brubaker (nolan-brubaker) wrote :

Agreed about making the diagnosis easier.

Not looking at the code, I'm unsure if the filename is available there or not. The hostname definitely should be, though.

Revision history for this message
Alexander Bashmakov (abashmak) wrote :

Here's a config that will cause a failure with no pertinent logging visible to the user, conf.d/glance.yml:

---
image_hosts:
  affinity:
    glance_container: 2
  aio1:
    ip: 172.29.236.100

Note, the problem with above config is the scope of affinity (should be under aio1 rather than image_hosts)

Praveen N (praveenn)
Changed in openstack-ansible:
assignee: Praveen N (praveenn) → nobody
Pauline (sebbenbear)
Changed in openstack-ansible:
assignee: nobody → Pauline (sebbenbear)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.