Yair Zaslavsky has uploaded a new change for review.

Change subject: [WIP] core: Improve -ldapServers support
......................................................................

[WIP] core: Improve -ldapServers support

Use the getLdapServers that in case the switch is not provided will lookup
for ldap servers for the domain.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi/894681

Change-Id: If06f2b951e12c61be457d06527d86a14e74778b0
Signed-off-by: Yair Zaslavsky <[email protected]>
---
M 
backend/manager/tools/src/main/java/org/ovirt/engine/core/domains/ManageDomains.java
1 file changed, 11 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/37/13237/1

diff --git 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/domains/ManageDomains.java
 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/domains/ManageDomains.java
index c8c2425..2901b65 100644
--- 
a/backend/manager/tools/src/main/java/org/ovirt/engine/core/domains/ManageDomains.java
+++ 
b/backend/manager/tools/src/main/java/org/ovirt/engine/core/domains/ManageDomains.java
@@ -409,8 +409,7 @@
                 ldapServersEntry,
                 ldapServerPort,
                 false,
-                true,
-                null);
+                true);
     }
 
     public void getConfiguration() {
@@ -502,14 +501,8 @@
         authModeEntry.setValueForDomain(domainName, authMode);
         ldapProviderTypesEntry.setValueForDomain(domainName, 
ldapProviderType.name());
 
-        String ldapServersStr = parser.getArg(Arguments.ldapServers.name());
-        if (!StringUtils.isEmpty(ldapServersStr)) {
-            //Replacing "," with ";" - from user perspective of the utility, 
passing comma delimited string makes more sense and more natural
-            //But "," is used as domain separate character when storing to DB.
-            ldapServersStr = ldapServersStr.replace(',',';');
-            ldapServersEntry.setValueForDomain(domainName, ldapServersStr);
-        }
-
+        String ldapServersStr = StringUtils.join(ldapServers, ";");
+        ldapServersEntry.setValueForDomain(domainName, ldapServersStr);
 
         testConfiguration(domainName,
                 domainNameEntry,
@@ -521,8 +514,7 @@
                 ldapServersEntry,
                 ldapServerPort,
                 true,
-                false,
-                ldapServers);
+                false);
 
         handleAddPermissions(domainName, adUserNameEntry, adUserIdEntry);
 
@@ -637,13 +629,13 @@
             adUserPasswordEntry.setValueForDomain(domainName, password);
         }
 
-        if (authMode.equalsIgnoreCase(LdapAuthModeEnum.SIMPLE.name())) {
-            ldapServersEntry.setValueForDomain(domainName, 
utilityConfiguration.getLocalHostEntry());
-        }
         LdapProviderType ldapProviderType = getLdapProviderType(parser);
         if (ldapProviderType != null) {
             ldapProviderTypeEntry.setValueForDomain(domainName, 
ldapProviderType.name());
         }
+
+        String ldapServersStr = StringUtils.join(ldapServers, ";");
+        ldapServersEntry.setValueForDomain(domainName, ldapServersStr);
 
         testConfiguration(domainName,
                 domainNameEntry,
@@ -655,8 +647,7 @@
                 ldapServersEntry,
                 ldapServerPort,
                 true,
-                false,
-                ldapServers);
+                false);
 
         handleAddPermissions(domainName,adUserNameEntry, adUserIdEntry);
 
@@ -703,8 +694,7 @@
             Map<String,List<String>> ldapServersPerDomainMap,
             String kerberosConfigFile,
             String ldapServerPort,
-            boolean isValidate,
-            List<String> ldapServers) throws ManageDomainsResult {
+            boolean isValidate) throws ManageDomainsResult {
 
         Set<Entry<String, String>> gssapiDomainValues = 
gssapiDomains.getValues();
 
@@ -832,8 +822,7 @@
             DomainsConfigurationEntry ldapServersEntry,
             String ldapServerPort,
             boolean reconfigure,
-            boolean isValidate,
-            List<String> ldapServers) throws ManageDomainsResult {
+            boolean isValidate) throws ManageDomainsResult {
 
         Set<Entry<String, String>> domainValues = domains.getValues();
 
@@ -898,8 +887,7 @@
                     ldapServersPerGSSAPIDomains,
                     kerberosConfigFile,
                     ldapServerPort,
-                    isValidate,
-                    ldapServers);
+                    isValidate);
             if (domainIsGssapi && reconfigure) {
                 applyKerberosConfiguration();
             }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If06f2b951e12c61be457d06527d86a14e74778b0
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to