Alon Bar-Lev has posted comments on this change.

Change subject: aaa: Fix sync
......................................................................


Patch Set 8:

(3 comments)

ok, great!!!! finally we have something that human (alonbl) can understand... :)

now, please explain why we need DirectoryXXX?!?!?! we can just use 
PrincipalRecord/GroupRecord, and AuthzUtils.

http://gerrit.ovirt.org/#/c/29706/8/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 40:         for (String authz : authzToNamespaceToUserIds.keySet()) {
Line 41:             try {
Line 42:                 ExtensionProxy authzExtension = 
EngineExtensionsManager.getInstance().getExtensionByName(authz);
Line 43:                 for (Entry<String, Set<String>> userIdsPerNamespace : 
authzToNamespaceToUserIds.get(authz).entrySet()) {
Line 44:                     Set<String> userIds = 
userIdsPerNamespace.getValue();
no reason for temp var
Line 45:                     for (DirectoryUser directoryUser : 
DirectoryUtils.fetchUsersByIdsRecursively(authzExtension, 
userIdsPerNamespace.getKey(), new ArrayList<String>(userIds))) {
Line 46:                         DirectoryUtils.flatGroups(directoryUser);
Line 47:                         DbUser dbUser = new DbUser(directoryUser);
Line 48:                         
dbUser.setGroupIds(DirectoryUtils.getGroupIdsFromUser(directoryUser));


Line 41:             try {
Line 42:                 ExtensionProxy authzExtension = 
EngineExtensionsManager.getInstance().getExtensionByName(authz);
Line 43:                 for (Entry<String, Set<String>> userIdsPerNamespace : 
authzToNamespaceToUserIds.get(authz).entrySet()) {
Line 44:                     Set<String> userIds = 
userIdsPerNamespace.getValue();
Line 45:                     for (DirectoryUser directoryUser : 
DirectoryUtils.fetchUsersByIdsRecursively(authzExtension, 
userIdsPerNamespace.getKey(), new ArrayList<String>(userIds))) {
please indent:

 for (
     xxx :
     yyy(
          prm1,
          prm2,
          ...
    )
 ) {
Line 46:                         DirectoryUtils.flatGroups(directoryUser);
Line 47:                         DbUser dbUser = new DbUser(directoryUser);
Line 48:                         
dbUser.setGroupIds(DirectoryUtils.getGroupIdsFromUser(directoryUser));
Line 49:                         activeUsers.add(dbUser);


Line 50:                     }
Line 51:                 }
Line 52:             } catch (ConfigurationException ex) {
Line 53:                 log.error(String.format("The authz extension for %1%s 
has not been found. Users belonging to this extension will be marked as 
inactive. Exception message is %2$s",
Line 54:                         authz, ex.getMessage()));
debug stack trace?
Line 55:             }
Line 56:         }
Line 57: 
Line 58:         Set<DbUser> inactiveUsers = new HashSet<DbUser>(dbUsers) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3a66a7c235f16ff26cac3a779de688c73d67f4a2
Gerrit-PatchSet: 8
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