'Return the name of the snapshot associated with backup_id.
The rbd image provided must be the base image used for an incremental
backup.
A backup is only allowed ONE associated snapshot. If more are found,
exception.BackupOperationError is raised.'

def _get_backup_snap_name(self, rbd_image, name, backup_id):

    snaps = self.get_backup_snaps(rbd_image)
    LOG.debug("Looking    for    snapshot    of    backup    base    '%s'", name)
    if (not snaps):
        LOG.debug("Backup    base    '%s'    has    no    snapshots", name)
        return None
    snaps = [snap['name'] for snap in snaps if (snap['backup_id'] == backup_id)]
    if (not snaps):
        LOG.debug("Backup    '%s'    has    no    snapshot", backup_id)
        return None
    if (len(snaps) > 1):
        msg = (_('Backup    should    only    have    one    snapshot    but    instead    has    %s') % len(snaps))
        LOG.error(msg)
        raise exception.BackupOperationError(msg)
    LOG.debug("Found    snapshot    '%s'", snaps[0])
    return snaps[0]
