<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _check_disks_in_diskgroup(disk_group, cache_disk_id, capacity_disk_ids):
    '''
    Checks that the disks in a disk group are as expected and raises
    CheckError exceptions if the check fails
    '''
    if not disk_group.ssd.canonicalName == cache_disk_id:
        raise salt.exceptions.ArgumentValueError(
            'Incorrect diskgroup cache disk; got id: \'{0}\'; expected id: '
            '\'{1}\''.format(disk_group.ssd.canonicalName, cache_disk_id))
    non_ssd_disks = [d.canonicalName for d in disk_group.nonSsd]
    if sorted(non_ssd_disks) != sorted(capacity_disk_ids):
        raise salt.exceptions.ArgumentValueError(
            'Incorrect capacity disks; got ids: \'{0}\'; expected ids: \'{1}\''
            ''.format(sorted(non_ssd_disks),
                      sorted(capacity_disk_ids)))
    log.trace('Checked disks in diskgroup with cache disk id \'%s\'',
              cache_disk_id)
    return True