# core.cloud.openstack Error Fetching Image List

**URL:** <https://forum.ansible.com/t/core-cloud-openstack-error-fetching-image-list/19982>\
**Category:** Ansible Project\
**Created:** [December 10, 2015, 6:01pm UTC](https://forum.ansible.com/t/core-cloud-openstack-error-fetching-image-list/19982 "2015-12-10T18:01:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugh\_Ma](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@Hugh\_Ma](https://forum.ansible.com/u/Hugh_Ma)\
**Post date:** [December 10, 2015, 6:01pm UTC](https://forum.ansible.com/t/core-cloud-openstack-error-fetching-image-list/19982/1 "2015-12-10T18:01:21Z")

</div>

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/](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  
[https://github.com/openstack-infra/shade/blob/master/shade/openstackcloud.py#L1163-L1165](https://github.com/openstack-infra/shade/blob/master/shade/openstackcloud.py#L1163-L1165)

The old nova\_server module works fine, so not sure what the issue is.

---

<div class="post-metadata">

**Author:** ![Hugh\_Ma](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@Hugh\_Ma](https://forum.ansible.com/u/Hugh_Ma)\
**Post date:** [December 10, 2015, 7:08pm UTC](https://forum.ansible.com/t/core-cloud-openstack-error-fetching-image-list/19982/2 "2015-12-10T19:08:47Z")

</div>

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   
from glanceclient.v2.client import Client # noqa  
File “/usr/local/lib/python2.7/dist-packages/glanceclient/v2/client.py”, line 17, in   
from glanceclient.common import http  
File “/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py”, line 26, in   
ProtocolError = requests.packages.urllib3.exceptions.ProtocolError  
AttributeError: ‘module’ object has no attribute ‘packages’  
Error fetching image list: ‘module’ object has no attribute ‘packages’

---

<div class="post-metadata">

**Author:** ![David\_Shrewsbury1](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@David\_Shrewsbury1](https://forum.ansible.com/u/David_Shrewsbury1)\
**Post date:** [December 11, 2015, 5:08pm UTC](https://forum.ansible.com/t/core-cloud-openstack-error-fetching-image-list/19982/3 "2015-12-11T17:08:53Z")

</div>

What version of python-glanceclient and requests do you have installed?

---

<div class="post-metadata">

**Author:** ![Hugh\_Ma](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@Hugh\_Ma](https://forum.ansible.com/u/Hugh_Ma)\
**Post date:** [December 14, 2015, 8:10pm UTC](https://forum.ansible.com/t/core-cloud-openstack-error-fetching-image-list/19982/4 "2015-12-14T20:10:57Z")

</div>

> > > glanceclient. **version**  
> > > ‘1.2.0’  
> > > print requests. **version**  
> > > 2.2.1

---

<div class="post-metadata">

**Author:** ![David\_Shrewsbury1](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@David\_Shrewsbury1](https://forum.ansible.com/u/David_Shrewsbury1)\
**Post date:** [December 15, 2015, 1:51pm UTC](https://forum.ansible.com/t/core-cloud-openstack-error-fetching-image-list/19982/5 "2015-12-15T13:51:12Z")

</div>

Seems to have been a glance client bug:

[https://bugs.launchpad.net/python-glanceclient/+bug/1526254](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

---

<div class="post-metadata">

**Author:** ![Hugh\_Ma](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@Hugh\_Ma](https://forum.ansible.com/u/Hugh_Ma)\
**Post date:** [December 15, 2015, 3:16pm UTC](https://forum.ansible.com/t/core-cloud-openstack-error-fetching-image-list/19982/6 "2015-12-15T15:16:56Z")

</div>

Perfect thanks.
