How to setup image metadata with python API 0.11.0? [closed]

asked 2013-08-26 07:18:10 -0600

Skarab gravatar image

updated 2013-08-30 16:24:12 -0600

smaffulli gravatar image

I work with a DevStack-Grizzly installation. I add an image with metadata [see the code]. I use glance.images.create and provide metadata by properties argument. Unfortunately, the created image is without metadata (properties). image.get prints NONE.

import keystoneclient.v2_0.client as ksclient
import glanceclient

keystone = ksclient.Client(auth_url=credentials['auth-url'], username=credentials['username'],
                       password=credentials['password'], tenant_name=credentials['tenant'])

glance_endpoint = keystone.service_catalog.url_for(service_type='image',
                                                   endpoint_type='publicURL')
image_name="test-cirros"
image_file="cirros.img"

glance = glanceclient.Client('1',glance_endpoint, token=keystone.auth_token)

with open( image_file ) as fimage:
            image = glance.images.create(name=image_name, is_public=True, disk_format="qcow2", container_format="bare", data=fimage, properties =  {"aaaa": "13", "'bbbbbb": "12"} )

print image.get() // prints NONE

Is there other way of setting image metadata?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by rbowen
close date 2016-06-21 14:54:39.141121

Comments

The version of OpenStack that this is opened against has been declared EOL as per http://releases.openstack.org/ Please open a new issue if you are still seeing this problem with a more recent, supported version of OpenStack. Thanks.

rbowen gravatar imagerbowen ( 2016-06-21 14:54:34 -0600 )edit