yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #51613
[Bug 1580848] Re: Don't raise exception when import image without "image_properties"
Reviewed: https://review.openstack.org/319509
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=bcf372288da00a2959f107e3785d62cbbc6c5479
Submitter: Jenkins
Branch: master
commit bcf372288da00a2959f107e3785d62cbbc6c5479
Author: WenjunWang1992 <10191230@xxxxxxxxxx>
Date: Fri May 20 15:56:58 2016 +0800
Raise exception when import without properties
exception.Invalid will be raised when use task-create to import
image without properties, as task-create is a asynchronous action,
so we change task status to failure, and save the exception msg to
the task msg, the end users can get the msg when they use "task-show".
Change-Id: I08c26fd073e643d6ae7fef3475343442d24831b5
Closes-bug: #1580848
** Changed in: glance
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1580848
Title:
Don't raise exception when import image without "image_properties"
Status in Glance:
Fix Released
Bug description:
Problem on Mitaka.
I imported an image without "image_properties" in "input" JSON,and I
got these info.
glance --os-image-api-version 2 task-create --type import --input '{"import_from": "http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-i386-disk.img","import_from_format": "qcow2"}'
+------------+----------------------------------------------------------------------------------+
| Property | Value |
+------------+----------------------------------------------------------------------------------+
| created_at | 2016-05-12T03:27:52Z |
| id | a4d01698-9527-4ad8-9a9b-f72783af42e3 |
| input | {"import_from_format": "qcow2", "import_from": "http://download.cirros- |
| | cloud.net/0.3.3/cirros-0.3.3-i386-disk.img"} |
| message | |
| owner | d8f2596f60b4481e83a99f6644619fe5 |
| result | None |
| status | pending |
| type | import |
| updated_at | 2016-05-12T03:27:52Z |
+------------+----------------------------------------------------------------------------------+
This CMD was wrong,but no exception reported,
I got /opt/stack/logs/g-api.log:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/eventlet/greenpool.py", line 82, in _spawn_n_impl
func(*args, **kwargs)
File "/opt/stack/glance/glance/domain/proxy.py", line 238, in run
self.base.run(executor)
File "/opt/stack/glance/glance/notifier.py", line 550, in run
super(TaskProxy, self).run(executor)
File "/opt/stack/glance/glance/domain/proxy.py", line 238, in run
self.base.run(executor)
File "/opt/stack/glance/glance/domain/proxy.py", line 238, in run
self.base.run(executor)
File "/opt/stack/glance/glance/domain/__init__.py", line 432, in run
executor.begin_processing(self.task_id)
File "/opt/stack/glance/glance/async/taskflow_executor.py", line 107, in begin_processing
super(TaskExecutor, self).begin_processing(task_id)
File "/opt/stack/glance/glance/async/__init__.py", line 63, in begin_processing
self._run(task_id, task.type)
File "/opt/stack/glance/glance/async/taskflow_executor.py", line 128, in _run
flow = self._get_flow(task)
File "/opt/stack/glance/glance/async/taskflow_executor.py", line 81, in _get_flow
task_input = script_utils.unpack_task_input(task)
File "/opt/stack/glance/glance/common/scripts/utils.py", line 62, in unpack_task_input
raise exception.Invalid(msg)
Invalid: Input does not contain 'image_properties' field
so,I think we need to raise this exception to end user.
To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1580848/+subscriptions
References