#NEWLINE# def _fetch_image( context , session , instance , name_label , image_id , image_type ) : #NEWLINE# #INDENT# 'Fetch image from glance based on image type.\n\n    Returns: A single filename if image_type is KERNEL or RAMDISK\n             A list of dictionaries that describe VDIs, otherwise\n    ' #NEWLINE# if ( image_type == ImageType . DISK_VHD ) : #NEWLINE# #INDENT# vdis = _fetch_vhd_image ( context , session , instance , image_id ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# vdis = _fetch_disk_image ( context , session , instance , name_label , image_id , image_type ) #NEWLINE# #UNINDENT# for ( vdi_type , vdi ) in six . iteritems ( vdis ) : #NEWLINE# #INDENT# vdi_uuid = vdi [ 'uuid' ] #NEWLINE# LOG . debug ( "Fetched VDIs of type '%(vdi_type)s' with UUID '%(vdi_uuid)s'" , { #NEWLINE# #INDENT# 'vdi_type' : vdi_type , #NEWLINE# 'vdi_uuid' : vdi_uuid , #NEWLINE# #UNINDENT# } , instance = instance ) #NEWLINE# #UNINDENT# return vdis