← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1580848] [NEW] Don't raise exception when import image without "image_properties"

 

Public bug reported:

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.

** Affects: glance
     Importance: Undecided
     Assignee: Wenjun Wang (wangwenjun)
         Status: New

** Changed in: glance
     Assignee: (unassigned) => Wenjun Wang (wangwenjun)

** Description changed:

- I import an image without "image_properties" in "input" JSON,and I got
+ 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 is wrong,but no exception report,
+ 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)
+   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.

-- 
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:
  New

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


Follow ups