Yair Zaslavsky has posted comments on this change.

Change subject: aaa: reactivate user
......................................................................


Patch Set 6:

(3 comments)

http://gerrit.ovirt.org/#/c/29974/6/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddUserCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddUserCommand.java:

Line 38: 
Line 39:     @Override
Line 40:     protected void executeCommand() {
Line 41:         DbUser userToAdd = getParameters().getUserToAdd();
Line 42:         DbUser syncedUser = 
SyncUsers.sync(Arrays.asList(userToAdd)).get(0);
> it can return empty list... please make sure you take care of it.
i think the for i used before is more elegant.
Line 43:         if (Guid.isNullOrEmpty(syncedUser.getId()) && 
syncedUser.isActive()) {
Line 44:             DbFacade.getInstance().getDbUserDao().save(syncedUser);
Line 45:         } else {
Line 46:             if (!Guid.isNullOrEmpty(syncedUser.getId())) {


Line 42:         DbUser syncedUser = 
SyncUsers.sync(Arrays.asList(userToAdd)).get(0);
Line 43:         if (Guid.isNullOrEmpty(syncedUser.getId()) && 
syncedUser.isActive()) {
Line 44:             DbFacade.getInstance().getDbUserDao().save(syncedUser);
Line 45:         } else {
Line 46:             if (!Guid.isNullOrEmpty(syncedUser.getId())) {
> please move this isNullOrEmpty to outer scope condition, no reason to ask t
Done
Line 47:                 
DbFacade.getInstance().getDbUserDao().update(syncedUser);
Line 48:             }
Line 49:         }
Line 50:         
setActionReturnValue(DbFacade.getInstance().getDbUserDao().getByExternalId(userToAdd.getDomain(),
 userToAdd.getExternalId()).getId());


http://gerrit.ovirt.org/#/c/29974/6/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 70:                         log.info(String.format("The user %1$s from 
authz extension %2$s could not be found, and will be marked as inactive",
Line 71:                                 dbUser.getLoginName(),
Line 72:                                 dbUser.getDomain()));
Line 73:                         dbUser.setActive(false);
Line 74:                         usersToUpdate.add(dbUser);
> please move this down/up out of conditional, as there is common
this is not the same user, we agreed to ignore.
Line 75:                     }
Line 76:                 }
Line 77:             } catch (Exception ex) {
Line 78:                 log.error(String.format("Error during user 
synchronization of extension %1$s. Exception message is %2$s",


-- 
To view, visit http://gerrit.ovirt.org/29974
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I556d8da48a858ce193865e84fb6c7cb4043a8e5b
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@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

Reply via email to