Alon Bar-Lev has posted comments on this change. Change subject: aaa: change code of AddUser and AddGroup ......................................................................
Patch Set 7: (3 comments) http://gerrit.ovirt.org/#/c/30039/7/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddGroupCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddGroupCommand.java: Line 42: // need to update, if not we need to insert: Line 43: DbGroupDAO dao = getAdGroupDAO(); Line 44: DbGroup groupToAdd = getParameters().getGroupToAdd(); Line 45: DbGroup dbGroup = dao.getByExternalId(groupToAdd.getDomain(), groupToAdd.getExternalId()); Line 46: Guid id = Guid.newGuid(); shouldn't this happen only if new group? Line 47: if (dbGroup == null) { Line 48: groupToAdd.setId(id); Line 49: dao.save(groupToAdd); Line 50: } Line 48: groupToAdd.setId(id); Line 49: dao.save(groupToAdd); Line 50: } Line 51: else { Line 52: groupToAdd.setId(id); don't you need to preserve the id? why not do same magic as you have done in dbuser (setIfNeeded)? Line 53: dao.update(groupToAdd); Line 54: } Line 55: Line 56: // Return the identifier of the created group: http://gerrit.ovirt.org/#/c/30039/7/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SyncUsers.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SyncUsers.java: Line 69: log.info(String.format("The user %1$s from authz extension %2$s could not be found, and will be marked as inactive", Line 70: dbUser.getLoginName(), Line 71: dbUser.getDomain())); Line 72: dbUser.setActive(false); Line 73: DbFacade.getInstance().getDbUserDao().saveOrUpdate(dbUser); where do we not save user if it is new and not found in authz? I thought we return list of dbusers so that caller can decide Line 74: } Line 75: } Line 76: } catch (Exception ex) { Line 77: log.error(String.format("Error during user synchronization of extension %1$s. Exception message is %2$s", -- To view, visit http://gerrit.ovirt.org/30039 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If841c8d30d6ab2c5d06b1637cde93cfc65598a96 Gerrit-PatchSet: 7 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches