[Openstack-operators] Using novaclient, glanceclient, etc, from python

Ricardo Carrillo Cruz ricardo.carrillo.cruz at gmail.com
Fri Nov 25 10:48:48 UTC 2016


That is expected.

The shade calls accept name_or_id param for a lot of methods for
convenience.
In your case, as there are multiple images with the same name you should
pass the ID of the image you want to use, otherwise
shade cannot guess it.

2016-11-25 11:42 GMT+01:00 George Shuklin <george.shuklin at gmail.com>:

> shade fails if see too duplicate images in account.
>
> o = shade.OpenStackCloud(**creds)
> o.create_image(name=’killme’, filename=’/tmp/random_junk’, disk_format=’qcow2', container_format=’bare’, wait=True)
>
> Traceback (most recent call last):
>  ...
>   File "/usr/lib/python2.7/dist-packages/shade/openstackcloud.py", line 2269, in create_image
>     current_image = self.get_image(name)
>   File "/usr/lib/python2.7/dist-packages/shade/openstackcloud.py", line 1703, in get_image
>     return _utils._get_entity(self.search_images, name_or_id, filters)
>   File "/usr/lib/python2.7/dist-packages/shade/_utils.py", line 143, in _get_entity
>     "Multiple matches found for %s" % name_or_id)
> shade.exc.OpenStackCloudException: Multiple matches found for killme
>
>
>
> On 11/18/2016 12:20 AM, Clint Byrum wrote:
>
> You may find the 'shade' library a straight forward choice:
> http://docs.openstack.org/infra/shade/
>
> Excerpts from George Shuklin's message of 2016-11-17 20:17:08 +0200:
>
> Hello.
>
> I can't find proper documentation about how to use openstack clients
> from inside python application. All I can find is just examples and
> rather abstract (autogenerated) reference. Is there any normal
> documentation about proper way to use openstack clients from python
> applications?
>
>
> Thanks.
>
>
> _______________________________________________
> OpenStack-operators mailing listOpenStack-operators at lists.openstack.orghttp://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
>
>
> _______________________________________________
> OpenStack-operators mailing list
> OpenStack-operators at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-operators/attachments/20161125/6280d8b2/attachment.html>


More information about the OpenStack-operators mailing list