def upload_to_glance(request, image_id):
    if openstackUtils.connect_to_openstack():
        image = get_object_or_404(Image, pk=image_id)
        logger.debug('Uploading now!')
        if osUtils.check_path(image.filePath.path):
            openstackUtils.upload_image_to_glance(image.name, image.filePath.path)
        logger.debug('All done')
        return HttpResponseRedirect(('/images/%s' % image_id))
def upload_to_glance(request, image_id):
    if openstackUtils.connect_to_openstack():
        image = get_object_or_404(Image, pk=image_id)
        logger.debug('Uploading now!')
        if osUtils.check_path(image.filePath.path):
            openstackUtils.upload_image_to_glance(image.name, image.filePath.path)
        logger.debug('All done')
        return HttpResponseRedirect(('/images/%s' % image_id))