'Gets direct url for nfs backend.
It creates direct url from image_location
which is a tuple with direct_url and locations.
Returns url with nfs scheme if nfs store else returns url.
It needs to be verified by backend before use.'

def _get_image_nfs_url(self, image_location):

    (direct_url, locations) = image_location
    if ((not direct_url) and (not locations)):
        raise exception.NotFound(_('Image    location    not    present.'))
    if (not locations):
        return direct_url
    location = locations[0]
    url = location['url']
    if (not location['metadata']):
        return url
    location_type = location['metadata'].get('type')
    if ((not location_type) or (location_type.lower() != 'nfs')):
        return url
    share_location = location['metadata'].get('share_location')
    mount_point = location['metadata'].get('mount_point')
    if ((not share_location) or (not mount_point)):
        return url
    url_parse = urllib.parse.urlparse(url)
    abs_path = os.path.join(url_parse.netloc, url_parse.path)
    rel_path = os.path.relpath(abs_path, mount_point)
    direct_url = ('%s/%s' % (share_location, rel_path))
    return direct_url
