Pearl1594 commented on code in PR #11436:
URL: https://github.com/apache/cloudstack/pull/11436#discussion_r2607920383


##########
plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/ldap/LdapManagerImpl.java:
##########
@@ -432,14 +430,18 @@ private LinkDomainToLdapResponse linkDomainToLdap(Long 
domainId, String type, St
         LinkType linkType = LdapManager.LinkType.valueOf(type.toUpperCase());
         LdapTrustMapVO vo = _ldapTrustMapDao.persist(new 
LdapTrustMapVO(domainId, linkType, name, accountType, 0));
         DomainVO domain = domainDao.findById(vo.getDomainId());
+        String domainUuid = getDomainUuid(domain, vo);
+        return new LinkDomainToLdapResponse(domainUuid, 
vo.getType().toString(), vo.getName(), vo.getAccountType().ordinal());
+    }
+
+    private String getDomainUuid(DomainVO domain, LdapTrustMapVO vo) {
         String domainUuid = "<unknown>";
         if (domain == null) {
-            logger.error("no domain in database for id " + vo.getDomainId());
+            logger.error("no domain in database for id {}", vo.getDomainId());

Review Comment:
   Now that I looked at the code implementation - should we check if the domain 
exists before persisting it into the trust map and fail the process if domain 
isn't found, rather than just logging the error?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to