Repository: ambari Updated Branches: refs/heads/branch-2.5 bb163f19f -> 67a762ea8 refs/heads/trunk 1c115bc18 -> e55523012
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/67a762ea Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/67a762ea Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/67a762ea Branch: refs/heads/branch-2.5 Commit: 67a762ea8941303d4b8de536a0ed01d986129438 Parents: bb163f1 Author: Lisnichenko Dmitro <[email protected]> Authored: Wed Jan 25 17:09:00 2017 +0200 Committer: Lisnichenko Dmitro <[email protected]> Committed: Wed Jan 25 17:09:00 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/67a762ea/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 83fe01d..13efd89 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 @@ -5690,16 +5690,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/67a762ea/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 4caecd8..5f6dd72 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 @@ -1052,16 +1052,4 @@ 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); - } }
