block_device_mapping_v2 documentation incorrect

Bug #1804198 reported by Vladimir Prokofev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
Low
Takashi Natsume

Bug Description

Latest documentation[1] states that you must pass a dictionary for block_device_mapping_v2 and block_device_mapping, where as in reality it is a list of dictionaries, i.e.:

>>> mydict1={'key1': 'value1', 'key2': 'value2'}
>>> mydict2=[{'key1': 'value1', 'key2': 'value2'}]
>>> type(mydict1)
<type 'dict'>
>>> type(mydict2)
<type 'list'>

if you pass mydict1 - it will fail, while mydict2 works fine.
This is explicitly mentioned in code[2].
Should fix this confusing documentation.

[1] https://docs.openstack.org/python-novaclient/latest/reference/api/novaclient.v2.servers.html
[2] https://github.com/openstack/python-novaclient/blob/f0c63de21d180994a3635d04b778923a9a2247dc/novaclient/v2/servers.py#L712

Tags: doc
tags: added: doc
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

In _boot function, block_device_mapping should be passed as dict and block_device_mapping_v2 should be passed as list.
So the following comment is not correct.

https://github.com/openstack/python-novaclient/blob/f0c63de21d180994a3635d04b778923a9a2247dc/novaclient/v2/servers.py#L1232-L1233

Changed in python-novaclient:
status: New → Confirmed
assignee: nobody → Takashi NATSUME (natsume-takashi)
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/619145

Changed in python-novaclient:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/619145
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=1df18e2d99d397bd3f0a8e5d21ba2d68b106e9a6
Submitter: Zuul
Branch: master

commit 1df18e2d99d397bd3f0a8e5d21ba2d68b106e9a6
Author: Takashi NATSUME <email address hidden>
Date: Wed Nov 21 13:38:01 2018 +0900

    Fix a type of block_device_mapping_v2 in a comment

    Change-Id: I9c74402fbc4b2390b64265c6f174bc7e343900cc
    Closes-Bug: #1804198

Changed in python-novaclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-novaclient 12.0.0

This issue was fixed in the openstack/python-novaclient 12.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.