Glance create an image with incorrect location

Bug #1485792 reported by Kairat Kushaev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glance_store
Fix Released
High
Kairat Kushaev
Kilo
Fix Released
High
Kairat Kushaev
Liberty
Fix Released
High
Kairat Kushaev

Bug Description

I tried to upload images from location by way like using SCP:

# glance image-create --name LINUX-64 --is-public True --disk-format iso --container-format bare --progress --location http://<fuel_ip>:~/ubuntu-14.04.2-server-amd64.iso

# glance image-create --name LINUX-64-2 --is-public True --disk-format iso --container-format bare --progress --copy-from http://<fuel_ip>:~/ubuntu-14.04.2-server-amd64.iso

Glance client accepted wrong location and as result i got images in Glance with Active status and 0 size.
Same behavior noticed with aki and ari images.

Expected that Glance client will prevent creation of image from malformed source.

Changed in glance:
assignee: nobody → Kairat Kushaev (kkushaev)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance_store (master)

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

Changed in glance:
status: New → In Progress
Erno Kuvaja (jokke)
Changed in glance:
importance: Undecided → High
tags: added: liberty-rc-potential
affects: glance → glance-store
tags: removed: liberty-rc-potential
Revision history for this message
Kairat Kushaev (kkushaev) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance_store (stable/kilo)

Reviewed: https://review.openstack.org/229323
Committed: https://git.openstack.org/cgit/openstack/glance_store/commit/?id=dddb6f3357f1b9bbe52759b3bd1f3056aafcb168
Submitter: Jenkins
Branch: stable/kilo

commit dddb6f3357f1b9bbe52759b3bd1f3056aafcb168
Author: Kairat Kushaev <email address hidden>
Date: Tue Aug 18 01:34:58 2015 +0300

    Catch InvalidURL when requesting store size

    If location URL looks like scp address:
    http://some_address:~/some_image then glance accepts this address
    and creates a malformed image.
    The problem here is because python http_client lib is trying to
    recognize '~' as port but it is not acceptable port name.
    The lib generates an InvalidURL exception but this exception is
    hidden in one of universal catchers(except Exception).
    We need to validate port name (is present before passing it to
    http_client lib.

    Change-Id: I36dddf7059711fb15ecb1fec4e438daf2bffcb60
    Closes-bug: #1485792
    (cherry picked from commit caf646af81118af114d38320b83146ff6ae95a07)

Changed in glance-store:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance_store 0.9.2

This issue was fixed in the openstack/glance_store 0.9.2 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.