def detail(request, image_id):
    image = get_object_or_404(Image, pk=image_id)
    vm_type = 'N/A'
    for vt in configuration.vm_image_types:
        if (vt['name'] == image.type):
            vm_type = vt['description']
            break
    glance_id = ''
    image_state = ''
    if (configuration.deployment_backend == 'openstack'):
        openstackUtils.connect_to_openstack()
        glance_id = openstackUtils.get_image_id_for_name(image.name)
    elif ((configuration.deployment_backend == 'kvm') and (image.filePath != '')):
        image_state = osUtils.is_image_thin_provisioned(image.filePath.path)
    return render(request, 'images/details.html', {'image': image, 'state': image_state, 'vm_type': vm_type, 'settings': settings, 'glance_id': glance_id, 'use_openstack': configuration.use_openstack, 'openstack_host': configuration.openstack_host})
def detail(request, image_id):
    image = get_object_or_404(Image, pk=image_id)
    vm_type = 'N/A'
    for vt in configuration.vm_image_types:
        if (vt['name'] == image.type):
            vm_type = vt['description']
            break
    glance_id = 
    image_state = 
    if (configuration.deployment_backend == 'openstack'):
        openstackUtils.connect_to_openstack()
        glance_id = openstackUtils.get_image_id_for_name(image.name)
    elif ((configuration.deployment_backend == 'kvm') and (image.filePath != )):
        image_state = osUtils.is_image_thin_provisioned(image.filePath.path)
    return render(request, 'images/details.html', {'image': image, 'state': image_state, 'vm_type': vm_type, 'settings': settings, 'glance_id': glance_id, 'use_openstack': configuration.use_openstack, 'openstack_host': configuration.openstack_host})