ansible / ansible

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy and maintain. Automate everything from code deployment to network configuration to cloud management, in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com.
https://www.ansible.com/
GNU General Public License v3.0
63.16k stars 23.93k forks source link

openstack.py dynamic inventory fails with latest openstacksdk #39879

Closed bryfry closed 4 years ago

bryfry commented 6 years ago
ISSUE TYPE
COMPONENT NAME

contrib/inventory/openstack.py

ANSIBLE VERSION
 ansible --version
ansible 2.5.2
  config file = None
  configured module search path = [u'/home/student/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
CONFIGURATION

No config changes

OS / ENVIRONMENT

Ubuntu 16.04

SUMMARY

Openstack dynamic inventory fails to run a basic --list or --debug command because of import errors.

STEPS TO REPRODUCE
pip freeze | egrep "openstack|shade"
shade==1.28.0
openstacksdk==0.13.0
python-openstackclient==3.15.0
./openstack.py --list                                                                                 

or

./openstack.py --debug                                                                               
EXPECTED RESULTS

Module failures indicate openstacksdk changes which have not been accounted for in ansible's dynamic inventory code. Expect a normal running of the command to proceed without module errors.

ACTUAL RESULTS
./openstack.py --list                                                                                 
Traceback (most recent call last):
  File "./openstack.py", line 66, in <module>
    import os_client_config
  File "/usr/local/lib/python2.7/dist-packages/os_client_config/__init__.py", line 19, in <module>
    from os_client_config import cloud_config
  File "/usr/local/lib/python2.7/dist-packages/os_client_config/cloud_config.py", line 17, in <module>
    from openstack import _log
  File "/home/student/openstack.py", line 67, in <module>
    import shade
  File "/usr/local/lib/python2.7/dist-packages/shade/__init__.py", line 24, in <module>
    from shade.openstackcloud import OpenStackCloud
  File "/usr/local/lib/python2.7/dist-packages/shade/openstackcloud.py", line 24, in <module>
    import os_client_config.defaults
  File "/usr/local/lib/python2.7/dist-packages/os_client_config/defaults.py", line 17, in <module>
    from openstack.config import defaults
ImportError: No module named config
ansibot commented 6 years ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibot commented 6 years ago

cc @dagnello @emonty @j2sol @juliakreger @rcarrillocruz @shrews @thingee click here for bot help

sfeeser commented 6 years ago

Running "pip install -r requirements.txt --user" against this requirements.txt fixes the problem for now. Note the comment below on os-client-config. Hope this helps...

requirements.txt:

python-openstackclient==3.12.0 python-ironicclient==1.17.0 python-keystoneclient==3.13.0 python-neutronclient==6.2.0 python-novaclient==9.1.0 simplejson==3.11.1 os-client-config==1.28.0 #Note: 1.31.1 CAUSES the problem osc-lib==1.7.0 oslo.config==4.11.0 oslo.i18n==3.17.0 oslo.serialization==2.20.0 oslo.utils==3.33.0

ansibot commented 6 years ago

cc @omgjlk click here for bot help

ansibot commented 6 years ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibot commented 6 years ago

cc @Akasurde @BondAnthony @Qalthos @dav1x @ganeshrn @gdpak @gundalow @haroldwongms @intheclouddan @nitzmahone @privateip @rwaweber @ryansb @s-hertel @trishnaguha @trstringer @warthog9 @willthames @xscript @yuwzho @zbal @zikalino click here for bot help

gundalow commented 6 years ago

bot_status

ansibot commented 6 years ago

Components

contrib/inventory/abiquo.ini support: community maintainers:

contrib/inventory/abiquo.py support: community maintainers:

contrib/inventory/apache-libcloud.py support: community maintainers:

contrib/inventory/apstra_aos.ini support: community maintainers:

contrib/inventory/apstra_aos.py support: community maintainers:

contrib/inventory/azure_rm.ini support: community maintainers:

contrib/inventory/azure_rm.py support: community maintainers: haroldwongms nitzmahone trstringer xscript yuwzho zikalino

contrib/inventory/brook.ini support: community maintainers:

contrib/inventory/brook.py support: community maintainers:

contrib/inventory/cloudforms.ini support: community maintainers:

contrib/inventory/cloudforms.py support: community maintainers:

contrib/inventory/cloudstack.ini support: community maintainers:

contrib/inventory/cloudstack.py support: community maintainers:

contrib/inventory/cobbler.ini support: community maintainers:

contrib/inventory/cobbler.py support: community maintainers:

contrib/inventory/collins.ini support: community maintainers:

contrib/inventory/collins.py support: community maintainers:

contrib/inventory/consul_io.ini support: community maintainers:

contrib/inventory/consul_io.py support: community maintainers:

contrib/inventory/digital_ocean.ini support: community maintainers:

contrib/inventory/digital_ocean.py support: community maintainers: BondAnthony

contrib/inventory/docker.py support: community maintainers:

contrib/inventory/docker.yml support: community maintainers:

contrib/inventory/ec2.ini support: community maintainers:

contrib/inventory/ec2.py support: community maintainers:

contrib/inventory/fleet.py support: community maintainers:

contrib/inventory/foreman.ini support: community maintainers:

contrib/inventory/foreman.py support: community maintainers:

contrib/inventory/freeipa.py support: community maintainers:

contrib/inventory/gce.ini support: community maintainers:

contrib/inventory/gce.py support: community maintainers:

contrib/inventory/infoblox.py support: community maintainers: Qalthos ganeshrn gdpak gundalow privateip rcarrillocruz trishnaguha

contrib/inventory/infoblox.yaml support: community maintainers:

contrib/inventory/jail.py support: community maintainers:

contrib/inventory/landscape.py support: community maintainers:

contrib/inventory/libcloud.ini support: community maintainers:

contrib/inventory/libvirt_lxc.py support: community maintainers:

contrib/inventory/linode.ini support: community maintainers:

contrib/inventory/linode.py support: community maintainers: intheclouddan rwaweber zbal

contrib/inventory/lxc_inventory.py support: community maintainers:

contrib/inventory/lxd.ini support: community maintainers:

contrib/inventory/lxd.py support: community maintainers:

contrib/inventory/mdt.ini support: community maintainers:

contrib/inventory/mdt_dynamic_inventory.py support: community maintainers:

contrib/inventory/nagios_livestatus.ini support: community maintainers:

contrib/inventory/nagios_livestatus.py support: community maintainers:

contrib/inventory/nagios_ndo.ini support: community maintainers:

contrib/inventory/nagios_ndo.py support: community maintainers:

contrib/inventory/nsot.py support: community maintainers:

contrib/inventory/nsot.yaml support: community maintainers:

contrib/inventory/openshift.py support: community maintainers:

contrib/inventory/openstack.yml support: community maintainers:

contrib/inventory/openstack_inventory.py support: community maintainers:

contrib/inventory/openvz.py support: community maintainers:

contrib/inventory/ovirt.ini support: community maintainers:

contrib/inventory/ovirt.py support: community maintainers:

contrib/inventory/ovirt4.py support: community maintainers:

contrib/inventory/packet_net.ini support: community maintainers:

contrib/inventory/packet_net.py support: community maintainers:

contrib/inventory/proxmox.py support: community maintainers:

contrib/inventory/rackhd.py support: community maintainers:

contrib/inventory/rax.ini support: community maintainers:

contrib/inventory/rax.py support: community maintainers:

contrib/inventory/rhv.py support: community maintainers:

contrib/inventory/rudder.ini support: community maintainers:

contrib/inventory/rudder.py support: community maintainers:

contrib/inventory/scaleway.ini support: community maintainers:

contrib/inventory/scaleway.py support: community maintainers:

contrib/inventory/serf.py support: community maintainers:

contrib/inventory/softlayer.py support: community maintainers:

contrib/inventory/spacewalk.ini support: community maintainers:

contrib/inventory/spacewalk.py support: community maintainers:

contrib/inventory/ssh_config.py support: community maintainers:

contrib/inventory/stacki.py support: community maintainers:

contrib/inventory/stacki.yml support: community maintainers:

contrib/inventory/vagrant.py support: community maintainers:

contrib/inventory/vbox.py support: community maintainers:

contrib/inventory/vmware.ini support: community maintainers:

contrib/inventory/vmware.py support: community maintainers: Akasurde dav1x warthog9

contrib/inventory/vmware_inventory.ini support: community maintainers:

contrib/inventory/vmware_inventory.py support: community maintainers: Akasurde dav1x warthog9

contrib/inventory/zabbix.ini support: community maintainers:

contrib/inventory/zabbix.py support: community maintainers:

contrib/inventory/zone.py support: community maintainers:

lib/ansible/plugins/inventory/openstack.py support: core maintainers: dagnello emonty juliakreger omgjlk rcarrillocruz shrews thingee

test/units/contrib/inventory/init.py support: core maintainers:

test/units/contrib/inventory/test_vmware_inventory.py support: core maintainers:

Metadata

waiting_on: maintainer needs_info: False

click here for bot help

gtema commented 6 years ago

With PR https://github.com/ansible/ansible/pull/40532 (for 2.6) shade library retired in favor of openstacksdk and this script was renamed.

ansibot commented 6 years ago

cc @justjais click here for bot help

ansibot commented 6 years ago

cc @NilashishC @lwm @machacekondra click here for bot help

decentral1se commented 6 years ago

@ansibot looks like it is broken over here?!

gundalow commented 6 years ago

bot_status

ansibot commented 6 years ago

Components

contrib/inventory/abiquo.ini support: community maintainers:

contrib/inventory/abiquo.py support: community maintainers:

contrib/inventory/apache-libcloud.py support: community maintainers:

contrib/inventory/apstra_aos.ini support: community maintainers:

contrib/inventory/apstra_aos.py support: community maintainers:

contrib/inventory/azure_rm.ini support: community maintainers:

contrib/inventory/azure_rm.py support: community maintainers: haroldwongms nitzmahone trstringer xscript yuwzho zikalino

contrib/inventory/brook.ini support: community maintainers:

contrib/inventory/brook.py support: community maintainers:

contrib/inventory/cloudforms.ini support: community maintainers:

contrib/inventory/cloudforms.py support: community maintainers:

contrib/inventory/cloudstack.ini support: community maintainers:

contrib/inventory/cloudstack.py support: community maintainers:

contrib/inventory/cobbler.ini support: community maintainers:

contrib/inventory/cobbler.py support: community maintainers:

contrib/inventory/collins.ini support: community maintainers:

contrib/inventory/collins.py support: community maintainers:

contrib/inventory/consul_io.ini support: community maintainers:

contrib/inventory/consul_io.py support: community maintainers:

contrib/inventory/digital_ocean.ini support: community maintainers:

contrib/inventory/digital_ocean.py support: community maintainers: BondAnthony

contrib/inventory/docker.py support: community maintainers:

contrib/inventory/docker.yml support: community maintainers:

contrib/inventory/ec2.ini support: community maintainers:

contrib/inventory/ec2.py support: community maintainers:

contrib/inventory/fleet.py support: community maintainers:

contrib/inventory/foreman.ini support: community maintainers:

contrib/inventory/foreman.py support: community maintainers:

contrib/inventory/freeipa.py support: community maintainers:

contrib/inventory/gce.ini support: community maintainers:

contrib/inventory/gce.py support: community maintainers:

contrib/inventory/infoblox.py support: community maintainers: NilashishC Qalthos ganeshrn gdpak justjais rcarrillocruz trishnaguha

contrib/inventory/infoblox.yaml support: community maintainers:

contrib/inventory/jail.py support: community maintainers:

contrib/inventory/landscape.py support: community maintainers:

contrib/inventory/libcloud.ini support: community maintainers:

contrib/inventory/libvirt_lxc.py support: community maintainers:

contrib/inventory/linode.ini support: community maintainers:

contrib/inventory/linode.py support: community maintainers: intheclouddan lwm zbal

contrib/inventory/lxc_inventory.py support: community maintainers:

contrib/inventory/lxd.ini support: community maintainers:

contrib/inventory/lxd.py support: community maintainers:

contrib/inventory/mdt.ini support: community maintainers:

contrib/inventory/mdt_dynamic_inventory.py support: community maintainers:

contrib/inventory/nagios_livestatus.ini support: community maintainers:

contrib/inventory/nagios_livestatus.py support: community maintainers:

contrib/inventory/nagios_ndo.ini support: community maintainers:

contrib/inventory/nagios_ndo.py support: community maintainers:

contrib/inventory/nsot.py support: community maintainers:

contrib/inventory/nsot.yaml support: community maintainers:

contrib/inventory/openshift.py support: community maintainers:

contrib/inventory/openstack.yml support: community maintainers:

contrib/inventory/openstack_inventory.py support: community maintainers: dagnello emonty juliakreger omgjlk rcarrillocruz shrews thingee

contrib/inventory/openvz.py support: community maintainers:

contrib/inventory/ovirt.ini support: community maintainers:

contrib/inventory/ovirt.py support: community maintainers:

contrib/inventory/ovirt4.py support: community maintainers: machacekondra

contrib/inventory/packet_net.ini support: community maintainers:

contrib/inventory/packet_net.py support: community maintainers:

contrib/inventory/proxmox.py support: community maintainers:

contrib/inventory/rackhd.py support: community maintainers:

contrib/inventory/rax.ini support: community maintainers:

contrib/inventory/rax.py support: community maintainers:

contrib/inventory/rhv.py support: community maintainers:

contrib/inventory/rudder.ini support: community maintainers:

contrib/inventory/rudder.py support: community maintainers:

contrib/inventory/scaleway.ini support: community maintainers:

contrib/inventory/scaleway.py support: community maintainers:

contrib/inventory/serf.py support: community maintainers:

contrib/inventory/softlayer.py support: community maintainers:

contrib/inventory/spacewalk.ini support: community maintainers:

contrib/inventory/spacewalk.py support: community maintainers:

contrib/inventory/ssh_config.py support: community maintainers:

contrib/inventory/stacki.py support: community maintainers:

contrib/inventory/stacki.yml support: community maintainers:

contrib/inventory/vagrant.py support: community maintainers:

contrib/inventory/vbox.py support: community maintainers:

contrib/inventory/vmware.ini support: community maintainers:

contrib/inventory/vmware.py support: community maintainers: Akasurde dav1x warthog9

contrib/inventory/vmware_inventory.ini support: community maintainers:

contrib/inventory/vmware_inventory.py support: community maintainers: Akasurde dav1x warthog9

contrib/inventory/zabbix.ini support: community maintainers:

contrib/inventory/zabbix.py support: community maintainers:

contrib/inventory/zone.py support: community maintainers:

lib/ansible/plugins/inventory/openstack.py support: community maintainers: dagnello emonty juliakreger omgjlk rcarrillocruz shrews thingee

test/units/contrib/inventory/init.py support: core maintainers:

test/units/contrib/inventory/test_vmware_inventory.py support: core maintainers:

Metadata

waiting_on: maintainer needs_info: False

click here for bot help

ansibot commented 6 years ago

cc @displague @mnaser @rmcintosh click here for bot help

ansibot commented 5 years ago

cc @DBendit @Tomorrow9 @WojciechowskiPiotr @akshay196 @ares @cloudnull @danielmellado @danihodovic @dariko @ehelms @ekohl @felixfontein @goneri @jwitko @kassiansun @mgregson @mnecas @mwperina @odyssey4me @pgbidkar @tbouvet @xprazak2 @yungezz click here for bot help

ansibot commented 4 years ago

cc @gavinfish @haiyuazhang click here for bot help

ansibot commented 4 years ago

cc @jillr @tremble click here for bot help