set_metadata throws AttributeError: id, but actually sets the metadata
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-cinderclient |
Triaged
|
Low
|
Unassigned |
Bug Description
No errors from CLI, but when using python-
See below:
>>> volume = cinder_
>>> volume.metadata
{u'readonly': u'False'}
>>> volume.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "cinderclient/
return "<Volume: %s>" % self.id
File "cinderclient/
self.get()
File "cinderclient/
new = self.manager.
File "cinderclient/
raise AttributeError(k)
AttributeError: id
>>> volume.id
u'de284b86-
>>> volume = cinder_
>>> volume.metadata
{u'readonly': u'False', u'hello': u'world'}
>>> cinder_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "cinderclient/
return "<Volume: %s>" % self.id
File "cinderclient/
self.get()
File "cinderclient/
new = self.manager.
File "cinderclient/
raise AttributeError(k)
AttributeError: id
>>> volume = cinder_
>>> volume.metadata
{u'readonly': u'False', u'foo': u'bar', u'hello': u'world'}
Changed in python-cinderclient: | |
assignee: | nobody → Juan Manuel Ollé (juan-m-olle) |
Changed in python-cinderclient: | |
assignee: | Juan Manuel Ollé (juan-m-olle) → Yuriy Nesenenko (ynesenenko) |
status: | New → Confirmed |
Changed in python-cinderclient: | |
importance: | Undecided → Low |
Changed in python-cinderclient: | |
assignee: | Yuriy Nesenenko (ynesenenko) → Ivan Kolodyazhny (e0ne) |
Verified:
>>> from cinderclient import client localhost: 5000/v2. 0') client. volumes. list() 812a-4862- bf9e-eb7a2a30bd f5>] client. volumes. get('4d942f28- 812a-4862- bf9e-eb7a2a30bd f5') client. volumes. set_metadata( '4d942f28- 812a-4862- bf9e-eb7a2a30bd f5',{'foo' :'bar'} ) python- cinderclient/ cinderclient/ v1/volumes. py", line 31, in __repr__ python- cinderclient/ cinderclient/ base.py" , line 268, in __getattr__ python- cinderclient/ cinderclient/ base.py" , line 287, in get get(self. id) python- cinderclient/ cinderclient/ base.py" , line 271, in __getattr__ client. volumes. get('4d942f28- 812a-4862- bf9e-eb7a2a30bd f5')
>>> cinder_client = client.Client('1', 'admin', 'xxxx', 'admin', 'http://
>>> cinder_
[<Volume: 4d942f28-
>>> volume = cinder_
>>> volume.metadata
{}
>>> cinder_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/stack/
return "<Volume: %s>" % self.id
File "/opt/stack/
self.get()
File "/opt/stack/
new = self.manager.
File "/opt/stack/
raise AttributeError(k)
AttributeError: id
>>> volume.metadata
{}
>>> volume = cinder_
>>> volume.metadata
{u'foo': u'bar'}
>>>