Log message "fetching image %s from glance" is written in wrong place

Bug #1292984 reported by Jay Pipes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Unassigned

Bug Description

In nova.image.glance:

def get_remote_image_service(context, image_href):
    """Create an image_service and parse the id from the given image_href.

    The image_href param can be an href of the form
    'http://example.com:9292/v1/images/b8b2c6f7-7345-4e2f-afa2-eedaba9cbbe3',
    or just an id such as 'b8b2c6f7-7345-4e2f-afa2-eedaba9cbbe3'. If the
    image_href is a standalone id, then the default image service is returned.

    :param image_href: href that describes the location of an image
    :returns: a tuple of the form (image_service, image_id)

    """
    # Calling out to another service may take a while, so lets log this
    LOG.debug(_("fetching image %s from glance") % image_href)
    #NOTE(bcwaldon): If image_href doesn't look like a URI, assume its a
    # standalone image ID
    if '/' not in str(image_href):
        image_service = get_default_image_service()
        return image_service, image_href

    try:
        (image_id, glance_host, glance_port, use_ssl) = \
            _parse_image_ref(image_href)
        glance_client = GlanceClientWrapper(context=context,
                host=glance_host, port=glance_port, use_ssl=use_ssl)
    except ValueError:
        raise exception.InvalidImageRef(image_href=image_href)

    image_service = GlanceImageService(client=glance_client)
    return image_service, image_id

Clearly the LOG.debug() message above is incorrect. The method does not fetch an image at all. It just returns an ImageService object.

Changed in nova:
assignee: nobody → Santiago Baldassin (santiago-b-baldassin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/80834
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8d2b250105564bc3288bf01881dfdc7f48012708
Submitter: Jenkins
Branch: master

commit 8d2b250105564bc3288bf01881dfdc7f48012708
Author: Jay Pipes <email address hidden>
Date: Sun Mar 16 09:14:21 2014 -0400

    Remove bad log message in get_remote_image_service

    There was a LOG.debug() message in the
    nova.image.glance.get_remote_image_service() call that was incorrect and
    misleading:

    LOG.debug(_("fetching image %s from glance") % image_href)

    This function actually does not fetch any image from Glance -- rather,
    it is just used to get the default image service object or an image
    service object for use with a remote Glance server.

    Change-Id: I2b71c2c52d6593ad4677767a6f2bb40c399fe9eb
    Closes-bug: #1292984

Changed in nova:
status: New → Fix Committed
Changed in nova:
assignee: Santiago Baldassin (santiago-b-baldassin) → nobody
Changed in nova:
milestone: none → icehouse-rc1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-rc1 → 2014.1
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.