if we firstly create a volume without volume type,using cli:upload-to-image will report error.

Bug #1847449 reported by Leopard Ma on 2019-10-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Undecided
Leopard Ma

Bug Description

You can use the following steps to reproduce:
1)cinder create --name test 1
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2019-10-09T09:16:16.000000 |
| description | None |
| encrypted | False |
| id | 734a5628-7b2a-4906-b0c3-aa5cb0e77b70 |
| metadata | {} |
| migration_status | None |
| multiattach | False |
| name | test |
| os-vol-host-attr:host | None |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | db3489c66ec04f9bab7ac6beecb5d724 |
| replication_status | None |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| updated_at | None |
| user_id | b69bb06c8dca44709952dd4f06b5b939 |
| volume_type | None |
+--------------------------------+--------------------------------------+
2) cinder show 734a5628-7b2a-4906-b0c3-aa5cb0e77b70
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attached_servers | [] |
| attachment_ids | [] |
| availability_zone | nova |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2019-10-09T09:16:16.000000 |
| description | None |
| encrypted | False |
| id | 734a5628-7b2a-4906-b0c3-aa5cb0e77b70 |
| metadata | |
| migration_status | None |
| multiattach | False |
| name | test |
| os-vol-host-attr:host | node01@lvmdriver-1#lvmdriver-1 |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | db3489c66ec04f9bab7ac6beecb5d724 |
| replication_status | None |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | available |
| updated_at | 2019-10-09T09:16:18.000000 |
| user_id | b69bb06c8dca44709952dd4f06b5b939 |
| volume_type | None |
+--------------------------------+--------------------------------------+

3)cinder --debug upload-to-image 734a5628-7b2a-4906-b0c3-aa5cb0e77b70 test_upload_image

DEBUG (shell:914) 'NoneType' object has no attribute '__getitem__'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cinderclient/shell.py", line 909, in main
    for item in sys.argv[1:]])
  File "/usr/lib/python2.7/site-packages/cinderclient/shell.py", line 729, in main
    args.func(self.cs, args)
  File "/usr/lib/python2.7/site-packages/cinderclient/v3/shell.py", line 924, in do_upload_to_image
    args.disk_format))
  File "/usr/lib/python2.7/site-packages/cinderclient/shell_utils.py", line 32, in print_volume_image
    image[1]['os-volume_upload_image']['volume_type']['name'])
TypeError: 'NoneType' object has no attribute '__getitem__'
DEBUG:cinderclient.shell:'NoneType' object has no attribute '__getitem__'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cinderclient/shell.py", line 909, in main
    for item in sys.argv[1:]])
  File "/usr/lib/python2.7/site-packages/cinderclient/shell.py", line 729, in main
    args.func(self.cs, args)
  File "/usr/lib/python2.7/site-packages/cinderclient/v3/shell.py", line 924, in do_upload_to_image
    args.disk_format))
  File "/usr/lib/python2.7/site-packages/cinderclient/shell_utils.py", line 32, in print_volume_image
    image[1]['os-volume_upload_image']['volume_type']['name'])
TypeError: 'NoneType' object has no attribute '__getitem__'
ERROR: 'NoneType' object has no attribute '__getitem__'

Leopard Ma (leopardma) on 2019-10-09
Changed in python-cinderclient:
assignee: nobody → Leopard Ma (leopardma)
Leopard Ma (leopardma) on 2019-10-09
Changed in python-cinderclient:
status: New → Incomplete
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers