core.cloud.openstack Error Fetching Image List

140 views
Skip to first unread message

Hugh Ma

unread,
Dec 10, 2015, 1:01:21 PM12/10/15
to Ansible Project
Running into an issue on 2.0 rc2 and latest dev version (2.1)

TASK [common : launch a compute instance] **************************************
task path: /home/cluser/automata_ansible/automata_ansible_openstack/openstack/roles/common/tasks/main.yml:2
ESTABLISH LOCAL CONNECTION FOR USER: root
localhost EXEC ( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1449770098.45-120356728371449 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1449770098.45-120356728371449 )" )
localhost PUT /tmp/tmpCI8UeX TO /root/.ansible/tmp/ansible-tmp-1449770098.45-120356728371449/os_server
localhost EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1449770098.45-120356728371449/os_server; rm -rf "/root/.ansible/tmp/ansible-tmp-1449770098.45-120356728371449/" > /dev/null 2>&1
fatal: [localhost]: FAILED! => {"changed": false, "extra_data": null, "failed": true, "invocation": {"module_args": {"auth": {"auth_url": "http://172.16.0.6:5000/v2.0/", "password": "admin", "project_name": "admin", "username": "admin"}, "auto_ip": true, "availability_zone": "nova", "flavor": 3, "image": "ubuntu_trusty", "key_name": "test", "name": "vm2", "nics": [{"net-id": "f4d99c4b-0931-4a3a-b884-2129816b1db1"}], "security_groups": "default", "state": "present", "timeout": 200}, "module_name": "os_server"}, "msg": "Error fetching image list: 'module' object has no attribute 'packages'"}

I put in various checks along os_server.py but it seems the issue is coming from cloud.get_image_id() which eventually leads to def list_images() here

The old nova_server module works fine, so not sure what the issue is. 

Hugh Ma

unread,
Dec 10, 2015, 2:08:47 PM12/10/15
to Ansible Project
This is from the inventory script. Everything is fine until it hits glance to pull the image object.

Couldn't construct image object
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/shade/openstackcloud.py", line 254, in _get_client
    **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/os_client_config/cloud_config.py", line 300, in get_legacy_client
    return client_class(*constructor_args, **constructor_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/client.py", line 59, in Client
    module = utils.import_versioned_module(int(version), 'client')
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/utils.py", line 281, in import_versioned_module
    return importutils.import_module(module)
  File "/usr/local/lib/python2.7/dist-packages/oslo_utils/importutils.py", line 73, in import_module
    __import__(import_str)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/__init__.py", line 15, in <module>
    from glanceclient.v2.client import Client      # noqa
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/client.py", line 17, in <module>
    from glanceclient.common import http
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 26, in <module>
    ProtocolError = requests.packages.urllib3.exceptions.ProtocolError
AttributeError: 'module' object has no attribute 'packages'

David Shrewsbury

unread,
Dec 11, 2015, 12:08:53 PM12/11/15
to Ansible Project
What version of python-glanceclient and requests do you have installed?

Hugh Ma

unread,
Dec 14, 2015, 3:10:57 PM12/14/15
to Ansible Project
>>> glanceclient.__version__
'1.2.0'
>>> print requests.__version__
2.2.1

David Shrewsbury

unread,
Dec 15, 2015, 8:51:12 AM12/15/15
to Ansible Project
Seems to have been a glance client bug:

https://bugs.launchpad.net/python-glanceclient/+bug/1526254

You can try 'pip install -U requests' which may work around the issue for you until
a new glanceclient is released.

-Dave

Hugh Ma

unread,
Dec 15, 2015, 10:16:56 AM12/15/15
to Ansible Project
Perfect thanks.
Reply all
Reply to author
Forward
0 new messages