'Add or remove SELF.NAME to or from GROUP depending on ACTION.
ACTION can be \'add\' or \'remove\' otherwise \'remove\' is assumed.'

def _modify_group(self):

    rc = 0
    out = ''
    err = ''
    changed = False
    current = set(self._list_user_groups())
    if (self.groups is not None):
        target = set(self.groups.split(','))
    else:
        target = set([])
    if (self.append is False):
        for remove in (current - target):
            (_rc, _err, _out) = self.__modify_group(remove, 'delete')
            rc += rc
            out += _out
            err += _err
            changed = True
    for add in (target - current):
        (_rc, _err, _out) = self.__modify_group(add, 'add')
        rc += _rc
        out += _out
        err += _err
        changed = True
    return (rc, err, out, changed)
