ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject [1/2] ambari git commit: Revert "AMBARI-8705. Kerberos wizard: API call to save krb5-conf configuration fails with server error. (Robert Levas via yusaku)" Missing license header. This reverts commit 7f2cfb47d18c4dfa60fc7882dcd28d144734c3c9.
Date Mon, 15 Dec 2014 02:42:07 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 7f2cfb47d -> 744697576


Revert "AMBARI-8705. Kerberos wizard: API call to save krb5-conf configuration fails with
server error. (Robert Levas via yusaku)"
Missing license header.
This reverts commit 7f2cfb47d18c4dfa60fc7882dcd28d144734c3c9.


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

Branch: refs/heads/trunk
Commit: dbdd86268c275f4a7e2a2b3540f1b5989b7e738d
Parents: 7f2cfb4
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Sun Dec 14 18:40:17 2014 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Sun Dec 14 18:40:17 2014 -0800

----------------------------------------------------------------------
 .../server/serveraction/kerberos/KDCType.java   | 20 +----------
 .../kerberos/KerberosServerAction.java          |  2 +-
 .../serveraction/kerberos/KDCTypeTest.java      | 37 --------------------
 3 files changed, 2 insertions(+), 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dbdd8626/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCType.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCType.java
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCType.java
index 57b267d..51dcdd2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCType.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KDCType.java
@@ -18,8 +18,6 @@
 
 package org.apache.ambari.server.serveraction.kerberos;
 
-import com.sun.istack.NotNull;
-
 /**
  * Enumerates the supported KDC types
  */
@@ -32,21 +30,5 @@ public enum KDCType {
   /**
    * Indicates a Microsoft Active Directory
    */
-  ACTIVE_DIRECTORY;
-
-  /**
-   * Translates a String to a KDCType.
-   * <p/>
-   * The translation logic attempts to nicely convert a String to a KDCType by replacing
all '-'
-   * characters to '_' characters and converting the String to uppercase. Allowing for values
like
-   * "mit_kdc" to be translated to "MIT_KDC".
-   *
-   * @param value a String value to convert to a KDCType
-   * @return A KDCType
-   * @throws java.lang.IllegalArgumentException if this enum type has no constant with the
specified name
-   * @throws java.lang.NullPointerException if the value to translate is null
-   */
-  public static KDCType translate(@NotNull String value) {
-    return KDCType.valueOf(value.replace("-", "_").toUpperCase());
-  }
+  ACTIVE_DIRECTORY
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/dbdd8626/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerAction.java
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerAction.java
index 832602f..7a2412c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerAction.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerAction.java
@@ -121,7 +121,7 @@ public abstract class KerberosServerAction extends AbstractServerAction
{
 
     return ((kdcType == null) || kdcType.isEmpty())
         ? KDCType.MIT_KDC
-        : KDCType.translate(kdcType);
+        : KDCType.valueOf(kdcType.toUpperCase().replace("-", "_"));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/dbdd8626/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KDCTypeTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KDCTypeTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KDCTypeTest.java
deleted file mode 100644
index a45eac2..0000000
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/kerberos/KDCTypeTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.apache.ambari.server.serveraction.kerberos;
-
-import junit.framework.Assert;
-import org.junit.Test;
-
-public class KDCTypeTest {
-
-  @Test
-  public void testTranslateExact() {
-    Assert.assertEquals(KDCType.MIT_KDC, KDCType.translate("MIT_KDC"));
-  }
-
-  @Test
-  public void testTranslateCaseInsensitive() {
-    Assert.assertEquals(KDCType.MIT_KDC, KDCType.translate("mit_kdc"));
-  }
-
-  @Test
-  public void testTranslateHyphen() {
-    Assert.assertEquals(KDCType.MIT_KDC, KDCType.translate("MIT-KDC"));
-  }
-
-  @Test(expected = NullPointerException.class)
-  public void testTranslateNull() {
-    KDCType.translate(null);
-  }
-
-  @Test(expected = IllegalArgumentException.class)
-  public void testTranslateEmptyString() {
-    KDCType.translate("");
-  }
-
-  @Test(expected = IllegalArgumentException.class)
-  public void testTranslateNoTranslation() {
-    KDCType.translate("NO TRANSLATION");
-  }
-}
\ No newline at end of file


Mime
View raw message