You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2017/01/25 18:57:37 UTC

[48/50] [abbrv] ambari git commit: AMBARI-19695. Remove thrown exceptions while validating Kerberos Authentication configuration (echekanskiy via dlysnichenko)

AMBARI-19695. Remove thrown exceptions while validating Kerberos Authentication configuration (echekanskiy via dlysnichenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e5552301
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e5552301
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e5552301

Branch: refs/heads/branch-dev-patch-upgrade
Commit: e55523012a47727116657ce61ec681260b282b7e
Parents: 1c115bc
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Wed Jan 25 17:07:40 2017 +0200
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Wed Jan 25 17:09:19 2017 +0200

----------------------------------------------------------------------
 .../ambari/server/configuration/Configuration.java      |  6 ++----
 .../ambari/server/configuration/ConfigurationTest.java  | 12 ------------
 2 files changed, 2 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e5552301/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index 73c70dc..0c51576 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -5892,16 +5892,14 @@ public class Configuration {
       File keytabFile = new File(kerberosAuthProperties.getSpnegoKeytabFilePath());
       if (!keytabFile.exists()) {
         String message = String.format("The SPNEGO keytab file path (%s) specified in %s does not exist. " +
-                "This will cause issues authenticating users using Kerberos.",
+                "This will cause issues authenticating users using Kerberos. . Make sure proper keytab file provided later.",
             keytabFile.getAbsolutePath(), KERBEROS_AUTH_SPNEGO_KEYTAB_FILE.getKey());
         LOG.error(message);
-        throw new IllegalArgumentException(message);
       } else if (!keytabFile.canRead()) {
         String message = String.format("The SPNEGO keytab file path (%s) specified in %s cannot be read. " +
-                "This will cause issues authenticating users using Kerberos.",
+                "This will cause issues authenticating users using Kerberos. . Make sure proper keytab file provided later.",
             keytabFile.getAbsolutePath(), KERBEROS_AUTH_SPNEGO_KEYTAB_FILE.getKey());
         LOG.error(message);
-        throw new IllegalArgumentException(message);
       }
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5552301/ambari-server/src/test/java/org/apache/ambari/server/configuration/ConfigurationTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/configuration/ConfigurationTest.java b/ambari-server/src/test/java/org/apache/ambari/server/configuration/ConfigurationTest.java
index d7cb8a3..51114f8 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/configuration/ConfigurationTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/configuration/ConfigurationTest.java
@@ -988,18 +988,6 @@ public class ConfigurationTest {
     new Configuration(properties);
   }
 
-  @Test(expected = IllegalArgumentException.class)
-  public void testKerberosAuthenticationSPNEGOKeytabFileNotFound() {
-    Properties properties = new Properties();
-    properties.put(Configuration.KERBEROS_AUTH_ENABLED.getKey(), "true");
-    properties.put(Configuration.KERBEROS_AUTH_SPNEGO_KEYTAB_FILE.getKey(), "/path/to/missing/spnego/keytab/file");
-    properties.put(Configuration.KERBEROS_AUTH_SPNEGO_PRINCIPAL.getKey(), "spnego/principal@REALM");
-    properties.put(Configuration.KERBEROS_AUTH_USER_TYPES.getKey(), "LDAP, LOCAL");
-    properties.put(Configuration.KERBEROS_AUTH_AUTH_TO_LOCAL_RULES.getKey(), "DEFAULT");
-
-    new Configuration(properties);
-  }
-
   /**
    * Tests the default values for the {@link MetricsRetrievalService}.
    *