Image checking exception on smithy start command

Bug #1305786 reported by Stanislav Kudriashev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
anvil
Fix Released
Medium
Stanislav Kudriashev

Bug Description

Exception occurs when running smithy start command and image already exists in glance.

$ smithy -a start

...
INFO: @anvil.components.helpers.glance : Adding image cirros-0.3.1-x86_64-disk to glance.
INFO: @anvil.components.helpers.glance : Checking if image cirros-0.3.1-x86_64-disk already exists already in glance.
ERROR: @anvil.components.helpers.glance : Installing 'http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img' failed due to: Image named cirros-0.3.1-x86_64-disk already exists.
Traceback (most recent call last):
  File "/root/anvil/anvil/components/helpers/glance.py", line 453, in install
    (name, img_id) = img_handle.install()
  File "/root/anvil/anvil/components/helpers/glance.py", line 401, in install
    img_id = self._register(tgt_image_name, unpack_info)
  File "/root/anvil/anvil/components/helpers/glance.py", line 324, in _register
    self._check_name(image_name)
  File "/root/anvil/anvil/components/helpers/glance.py", line 282, in _check_name
    raise IOError("Image named %s already exists." % (name))
IOError: Image named cirros-0.3.1-x86_64-disk already exists.
...

Possibly need to check md5 sum and log warning/error message (but not exception) if file exists.

Changed in anvil:
assignee: nobody → Stanislav Kudriashev (skudriashev)
Changed in anvil:
status: New → In Progress
Joshua Harlow (harlowja)
Changed in anvil:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to anvil (master)

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

Revision history for this message
Stanislav Kudriashev (skudriashev) wrote :

Now start command output for image would be as following:

...
INFO: @anvil.components.helpers.glance : Adding image cirros-0.3.1-x86_64-disk to glance.
WARNING: @anvil.components.helpers.glance : Image cirros-0.3.1-x86_64-disk already exists in glance.
...

Just warning is printed. I think this is just what is needed.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to anvil (master)

Reviewed: https://review.openstack.org/87211
Committed: https://git.openstack.org/cgit/stackforge/anvil/commit/?id=87150451fc3535fb7ed3c13e035185e075377172
Submitter: Jenkins
Branch: master

commit 87150451fc3535fb7ed3c13e035185e075377172
Author: Stanislav Kudriashev <email address hidden>
Date: Mon Apr 14 05:25:11 2014 -0400

    Improve image processing on start command

    * Added DuplicateException to properly handle case when
      same image already exists in glance;
    * Implemented image cache to handle cached image files;
    * Got rid of Registry as it is really needed;
    * Other refactoring and clean-ups.

    Change-Id: I512a6ecc104d4a5f23d52f4ad9ba1e80b33065cc
    Closes-Bug: #1305786

Changed in anvil:
status: In Progress → Fix Committed
Joshua Harlow (harlowja)
Changed in anvil:
status: Fix Committed → Fix Released
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.