'Check whether the lun is associated to the lungroup.'

def _is_lun_associated_to_lungroup(self, lungroup_id, lun_id, lun_type=constants.LUN_TYPE):

    cmd_type = ('lun' if (lun_type == constants.LUN_TYPE) else 'snapshot')
    url = ('/%s/associate?TYPE=%s&ASSOCIATEOBJTYPE=256&ASSOCIATEOBJID=%s' % (cmd_type, lun_type, lungroup_id))
    result = self.call(url, None, 'GET')
    self._assert_rest_result(result, _('Check    lungroup    associate    error.'))
    if self._get_id_from_result(result, lun_id, 'ID'):
        return True
    return False
