DaanHoogland commented on code in PR #13948:
URL: https://github.com/apache/cloudstack/pull/13948#discussion_r3836590833


##########
plugins/user-authenticators/ldap/src/main/java/org/apache/cloudstack/ldap/LdapManagerImpl.java:
##########
@@ -488,6 +499,64 @@ public LinkAccountToLdapResponse 
linkAccountToLdap(LinkAccountToLdapCmd cmd) {
         return response;
     }
 
+    /**
+     * Replaces a domain's existing LDAP mapping, if any, instead of leaving a 
second
+     * {@link #linkDomainToLdap} call to fail on the domain_id/account_id 
unique key.
+     */
+    private void clearOldDomainMapping(Long domainId) {
+        LdapTrustMapVO oldVo = _ldapTrustMapDao.findByDomainId(domainId);
+        if (oldVo != null) {
+            ensureOldDomainMappingNotInUse(domainId, oldVo);
+            logger.warn(String.format("domain %d is already linked to ldap %s 
'%s'; replacing with the new mapping", domainId, oldVo.getType(), 
oldVo.getName()));

Review Comment:
   ```suggestion
               logger.warn("domain {} is already linked to ldap {} ‘{}'; 
replacing with the new mapping", domainId, oldVo.getType(), oldVo.getName());
   ```



-- 
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