# Dynamic inventory with OpenStack

**URL:** <https://forum.ansible.com/t/dynamic-inventory-with-openstack/22076>\
**Category:** Ansible Project\
**Created:** [July 21, 2016, 10:28am UTC](https://forum.ansible.com/t/dynamic-inventory-with-openstack/22076 "2016-07-21T10:28:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sergio\_gonzalez](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sergio\_gonzalez](https://forum.ansible.com/u/sergio_gonzalez)\
**Post date:** [July 21, 2016, 10:28am UTC](https://forum.ansible.com/t/dynamic-inventory-with-openstack/22076/1 "2016-07-21T10:28:22Z")

</div>

Hello

I am trying to use the dynamic inventory script:

$ ./openstack.py --host 10.2.1.111

Traceback (most recent call last):

File “./openstack.py”, line 246, in

main()

File “./openstack.py”, line 232, in main

inventory = shade.inventory.OpenStackInventory(\*\*inventory\_args)

File “/usr/local/lib/python2.7/dist-packages/shade/inventory.py”, line 35, in **init**

self.extra\_config = config.get\_extra\_config(

AttributeError: ‘OpenStackConfig’ object has no attribute ‘get\_extra\_config’

That line:

class OpenStackInventory(object):

# Put this here so the capability can be detected with hasattr on the class

extra\_config = None

config = os\_client\_config.config.OpenStackConfig(

config\_files=os\_client\_config.config.CONFIG\_FILES + config\_files)

#Line 35

self.extra\_config = config.get\_extra\_config(

config\_key, config\_defaults)

It is calling os\_client\_config.config.OpenStackConfig

This object has this method get\_extra\_config:

def get\_extra\_config(self, key, defaults=None):

“”"Fetch an arbitrary extra chunk of config, laying in defaults.

:param string key: name of the config section to fetch

:param dict defaults: (optional) default values to merge under the

found config

“”"

if not defaults:

defaults = {}

return \_merge\_clouds(

self.\_normalize\_keys(defaults),

self.\_normalize\_keys(self.cloud\_config.get(key, {})))

Any clue?

Regards

Sergio
