'check if there are group membership changes'

def needs_group_update(self):

    cmd = ['get', 'groups', '-o', 'json']
    all_groups = self.openshift_cmd(cmd, output=True)
    for group in all_groups['results']['items']:
        if ((group['metadata']['name'] in self.groups) and ((group['users'] is None) or (self.config.username not in group['users']))):
            return True
        elif ((group['users'] != None) and (self.config.username in group['users']) and (group['metadata']['name'] not in self.groups)):
            return True
    return False
