ambari git commit: AMBARI-9022. Preserve existing kerberos auth_to_local properties when scaling cluster

2015-02-11 Thread jspeidel
Repository: ambari
Updated Branches:
  refs/heads/trunk bb99a97bd -> 2ddd1004e


AMBARI-9022.  Preserve existing kerberos auth_to_local properties when scaling 
cluster


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

Branch: refs/heads/trunk
Commit: 2ddd1004ea82c59a247310f7e48d63540b5685a4
Parents: bb99a97
Author: John Speidel 
Authored: Tue Feb 10 17:36:24 2015 -0500
Committer: John Speidel 
Committed: Thu Feb 12 00:52:08 2015 -0500

--
 .../server/controller/AuthToLocalBuilder.java   | 475 ---
 .../server/controller/KerberosHelper.java   |   7 +-
 .../HDFS/2.1.0.2.0/configuration/core-site.xml  |   5 -
 .../controller/AuthToLocalBuilderTest.java  | 247 --
 4 files changed, 623 insertions(+), 111 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2ddd1004/ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java
index 6017bed..a22c759 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AuthToLocalBuilder.java
@@ -18,54 +18,72 @@
 
 package org.apache.ambari.server.controller;
 
-import java.util.Map;
-import java.util.TreeMap;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
 /**
  * AuthToLocalBuilder helps to create auth_to_local rules for use in 
configuration files like
- * core-site.xml.
+ * core-site.xml.  No duplicate rules will be generated.
  * 
- * For each principal appended to the rule set, parse out the primary value 
and match it to a local
- * username.  Then when done appending all principals, generate the rules 
where each entry yields
- * one of the following rule:
+ * Allows previously existing rules to be added verbatim.  Also allows new 
rules to be generated
+ * based on a principal and local username.  For each principal added to the 
builder, generate
+ * a rule conforming to one of the following formats:
  * 
- * Qualified Principal: RULE:[2:$1@$0](PRIMARY@REALM)s/.*\/LOCAL_USERNAME/
+ * Qualified Principal (the principal contains a user and host):
+ * RULE:[2:$1@$0](PRIMARY@REALM)s/.*\/LOCAL_USERNAME/
  * 
- * Unqualified Principal: RULE:[1:$1@$0](PRIMARY@REALM)s/.*\/LOCAL_USERNAME/
+ * Unqualified Principal (only user is specified):
+ * RULE:[1:$1@$0](PRIMARY@REALM)s/.*\/LOCAL_USERNAME/
+ * 
+ * Additionally, for each realm included in the rule set, generate a default 
realm rule
+ * in the format: RULE:[1:$1@$0](.*@REALM)s/@.{@literal *}//
+ * 
+ * Ordering guarantees for the generated rule string are as follows:
+ * 
+ *   Rules with the same expected component count are ordered according to 
match component count
+ *   Rules with different expected component count are ordered according 
to the default string ordering
+ *   Rules in the form of .*@REALM are ordered after all other rules with 
the same expected component count
+ * 
+ *
  */
 public class AuthToLocalBuilder {
 
   /**
-   * A Regular expression declaring a qualified principal such that the 
principal is in the following format:
-   * primary/instance@REALM
-   */
-  private static final Pattern PATTERN_QUALIFIED_PRINCIPAL = 
Pattern.compile("(\\w+)/.*@.*");
-
-  /**
-   * A Regular expression declaring an un qualified principal such that the 
principal is in the following format:
-   * primary@REALM
+   * Ordered set of rules which have been added to the builder.
*/
-  private static final Pattern PATTERN_UNQUALIFIED_PRINCIPAL = 
Pattern.compile("(\\w+)@.*");
+  private Set setRules = new TreeSet();
 
-  /**
-   * A map of qualified principal names (primary/instance@REALM, with instance 
and @REALM removed).
-   * 
-   * A TreeMap is used to help generate deterministic ordering of rules for 
testing.
-   */
-  private Map qualifiedAuthToLocalMap = new TreeMap();
 
   /**
-   * A map of unqualified principal names (primary@REALM, with @REALM removed).
-   * 
-   * A TreeMap is used to help generate deterministic ordering of rules for 
testing.
+   * Add existing rules from the given authToLocal configuration property.
+   * The rules are added verbatim.
+   *
+   * @param authToLocalRules config property value containing the existing 
rules
*/
-  private 

ambari git commit: Revert "AMBARI-9587. Add authorization provider for Knox. (yusaku)" Committed by accident. This reverts commit 590770a89101f01979eb4e48d6a05168688434b6.

2015-02-11 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk e75788568 -> bb99a97bd


Revert "AMBARI-9587. Add authorization provider for Knox. (yusaku)"
Committed by accident.
This reverts commit 590770a89101f01979eb4e48d6a05168688434b6.


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

Branch: refs/heads/trunk
Commit: bb99a97bd5bc3e19d2f7147eed21ef9e164a3926
Parents: e757885
Author: Yusaku Sako 
Authored: Wed Feb 11 21:34:21 2015 -0800
Committer: Yusaku Sako 
Committed: Wed Feb 11 21:34:21 2015 -0800

--
 .../common-services/KNOX/0.5.0.2.2/configuration/topology.xml  | 6 --
 1 file changed, 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/bb99a97b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
 
b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
index 80a226c..db16a21 100644
--- 
a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
+++ 
b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
@@ -66,12 +66,6 @@
 true
 
 
-
-authorization
-AclsAuthz
-true
-
-
 
 
 



[1/2] ambari git commit: AMBARI-9587. Add authorization provider for Knox. (yusaku)

2015-02-11 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk 41e275b1d -> e75788568


AMBARI-9587. Add authorization provider for Knox. (yusaku)


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

Branch: refs/heads/trunk
Commit: 590770a89101f01979eb4e48d6a05168688434b6
Parents: 41e275b
Author: Yusaku Sako 
Authored: Wed Feb 11 16:13:48 2015 -0800
Committer: Yusaku Sako 
Committed: Wed Feb 11 20:50:47 2015 -0800

--
 .../common-services/KNOX/0.5.0.2.2/configuration/topology.xml  | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/590770a8/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
 
b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
index db16a21..80a226c 100644
--- 
a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
+++ 
b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/topology.xml
@@ -66,6 +66,12 @@
 true
 
 
+
+authorization
+AclsAuthz
+true
+
+
 
 
 



[2/2] ambari git commit: Revert "AMBARI-9581. curl unable to connect to Ambari when SSLv3 and TLSv1 is disabled (aonishuk)"

2015-02-11 Thread yusaku
Revert "AMBARI-9581. curl unable to connect to Ambari when SSLv3 and TLSv1 is 
disabled (aonishuk)"

Unit test failures.
This reverts commit 4a25974b195aadb6ff12534e383e72b4aae6c5fb.


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

Branch: refs/heads/trunk
Commit: e757885683d769da5b84257b2ae115427aadce1e
Parents: 590770a
Author: Yusaku Sako 
Authored: Wed Feb 11 20:53:49 2015 -0800
Committer: Yusaku Sako 
Committed: Wed Feb 11 20:53:49 2015 -0800

--
 .../ambari_agent/AlertSchedulerHandler.py   |  5 +-
 .../src/main/python/ambari_agent/Controller.py  |  2 +-
 .../python/ambari_agent/alerts/script_alert.py  |  5 +-
 .../resource_management/core/constants.py   | 34 ++
 .../resource_management/core/environment.py |  9 ++-
 .../python/resource_management/core/source.py   | 71 +++-
 .../libraries/functions/__init__.py |  1 -
 .../libraries/functions/constants.py| 36 --
 .../libraries/script/__init__.py|  2 +-
 .../libraries/script/script.py  |  3 +-
 .../package/scripts/setup_ranger_hbase.py   | 12 +++-
 .../package/scripts/namenode_upgrade.py |  2 +-
 .../package/scripts/setup_ranger_hdfs.py| 12 +++-
 .../HIVE/0.12.0.2.0/package/scripts/hive.py | 27 ++--
 .../package/scripts/setup_ranger_hive.py| 12 +++-
 .../package/scripts/setup_ranger_knox.py| 12 +++-
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py| 26 +--
 .../package/scripts/oozie_server_upgrade.py |  2 +-
 .../0.4.0/package/scripts/setup_ranger.py   | 12 +++-
 .../package/scripts/setup_ranger_storm.py   | 12 +++-
 .../before-ANY/scripts/shared_initialization.py | 17 +++--
 .../scripts/shared_initialization.py| 16 +++--
 .../scripts/shared_initialization.py| 23 ---
 .../stacks/2.0.6/HIVE/test_hive_client.py   | 10 +--
 .../stacks/2.0.6/HIVE/test_hive_metastore.py| 14 ++--
 .../stacks/2.0.6/HIVE/test_hive_server.py   | 14 ++--
 .../2.0.6/hooks/before-ANY/test_before_any.py   | 10 +--
 .../hooks/before-INSTALL/test_before_install.py | 11 ++-
 .../stacks/2.1/HIVE/test_hive_metastore.py  | 14 ++--
 .../src/test/python/stacks/utils/RMFTestCase.py | 11 +--
 30 files changed, 247 insertions(+), 190 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e7578856/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py 
b/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py
index 87295d2..66b1758 100644
--- a/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py
+++ b/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py
@@ -53,7 +53,7 @@ class AlertSchedulerHandler():
   }
 
 
-  def __init__(self, cachedir, stacks_dir, common_services_dir, 
host_scripts_dir, config, in_minutes=True):
+  def __init__(self, cachedir, stacks_dir, common_services_dir, 
host_scripts_dir, in_minutes=True):
 self.cachedir = cachedir
 self.stacks_dir = stacks_dir
 self.common_services_dir = common_services_dir
@@ -69,7 +69,6 @@ class AlertSchedulerHandler():
 self._collector = AlertCollector()
 self.__scheduler = Scheduler(AlertSchedulerHandler.APS_CONFIG)
 self.__in_minutes = in_minutes
-self.config = config
 self.__config_maps = {}
 
 
@@ -282,7 +281,7 @@ class AlertSchedulerHandler():
   source['stacks_directory'] = self.stacks_dir
   source['common_services_directory'] = self.common_services_dir
   source['host_scripts_directory'] = self.host_scripts_dir
-  alert = ScriptAlert(json_definition, source, self.config)
+  alert = ScriptAlert(json_definition, source)
 elif source_type == AlertSchedulerHandler.TYPE_WEB:
   alert = WebAlert(json_definition, source)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e7578856/ambari-agent/src/main/python/ambari_agent/Controller.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/Controller.py 
b/ambari-agent/src/main/python/ambari_agent/Controller.py
index d597bca..f8a9f04 100644
--- a/ambari-agent/src/main/python/ambari_agent/Controller.py
+++ b/ambari-agent/src/main/python/ambari_agent/Controller.py
@@ -91,7 +91,7 @@ class Controller(threading.Thread):
 alerts_cache_dir = os.path.join(cache_dir, 'alerts')
 
 self.alert_scheduler_handler = AlertSchedulerHandler(alerts_cache_dir, 
-stacks_cache_dir, common_services_cache_dir, h

ambari git commit: AMBARI-9583. Add kerberos support for spark (Zhan Zhang via rlevas)

2015-02-11 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/trunk b9c9832cd -> 41e275b1d


AMBARI-9583. Add kerberos support for spark (Zhan Zhang via rlevas)


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

Branch: refs/heads/trunk
Commit: 41e275b1df128b18ee595e6b8b963f48312010ef
Parents: b9c9832
Author: Zhan Zhang 
Authored: Wed Feb 11 22:12:17 2015 -0500
Committer: Robert Levas 
Committed: Wed Feb 11 22:12:17 2015 -0500

--
 .../1.2.0.2.2/configuration/spark-defaults.xml  | 10 +
 .../SPARK/1.2.0.2.2/kerberos.json   | 40 
 .../package/scripts/job_history_server.py   |  4 ++
 .../SPARK/1.2.0.2.2/package/scripts/params.py   |  7 
 .../server/stack/KerberosDescriptorTest.java|  8 
 5 files changed, 69 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/41e275b1/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/configuration/spark-defaults.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/configuration/spark-defaults.xml
 
b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/configuration/spark-defaults.xml
index 564e697..20989b3 100644
--- 
a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/configuration/spark-defaults.xml
+++ 
b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/configuration/spark-defaults.xml
@@ -86,4 +86,14 @@
 
   
 
+  
+spark.history.kerberos.principal
+none
+  
+
+  
+spark.history.kerberos.keytab
+none
+  
+
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/41e275b1/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/kerberos.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/kerberos.json
 
b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/kerberos.json
new file mode 100644
index 000..499d0dd
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/kerberos.json
@@ -0,0 +1,40 @@
+{
+  "services": [
+{
+  "name": "SPARK",
+  "identities": [
+{
+  "name": "/smokeuser"
+}
+  ],
+  "components": [
+{
+  "name": "SPARK_JOBHISTORYSERVER",
+  "identities": [
+{
+  "name": "spark_historyserver",
+  "principal": {
+"value": "spark/_HOST@${realm}",
+"type" : "service",
+"configuration": 
"spark-defaults/spark.history.kerberos.principal",
+"local_username" : "${spark-env/spark_user}"
+  },
+  "keytab": {
+"file": "${keytab_dir}/spark.service.keytab",
+"owner": {
+  "name": "${spark-env/spark_user}",
+  "access": "r"
+},
+"group": {
+  "name": "${cluster-env/user_group}",
+  "access": ""
+},
+"configuration": "spark-defaults/spark.history.kerberos.keytab"
+  }
+}
+  ]
+}
+  ]
+}
+  ]
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/41e275b1/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/job_history_server.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/job_history_server.py
 
b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/job_history_server.py
index 7199ec4..06389c7 100644
--- 
a/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/job_history_server.py
+++ 
b/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/job_history_server.py
@@ -66,6 +66,10 @@ class JobHistoryServer(Script):
 env.set_params(params)
 self.configure(env)
 
+if params.security_enabled:
+  spark_kinit_cmd = format("{kinit_path_local} -kt {spark_kerberos_keytab} 
{spark_principal}; ")
+  Execute(spark_kinit_cmd, user=params.spark_user)
+
 # FIXME! TODO! remove this after soft link bug is fixed:
 if not os.path.islink('/usr/hdp/current/spark'):
   hdp_version = get_hdp_version()

http://git-wip-us.apache.org/repos/asf/ambari/blob/41e275b1/ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/params.py
--
di

ambari git commit: AMBARI-9580. Set kdc_type in kerberos-env rather than krb5-conf configuration (rlevas)

2015-02-11 Thread rlevas
Repository: ambari
Updated Branches:
  refs/heads/trunk 52250d5e1 -> b9c9832cd


AMBARI-9580. Set kdc_type in kerberos-env rather than krb5-conf configuration 
(rlevas)


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

Branch: refs/heads/trunk
Commit: b9c9832cd71a621e63b90002c0e04bd282dec5dc
Parents: 52250d5
Author: Robert Levas 
Authored: Wed Feb 11 19:21:15 2015 -0500
Committer: Robert Levas 
Committed: Wed Feb 11 19:21:15 2015 -0500

--
 .../server/controller/KerberosHelper.java   | 22 ++--
 .../1.10.3-10/configuration/kerberos-env.xml|  8 +++
 .../1.10.3-10/configuration/krb5-conf.xml   |  7 ---
 .../KERBEROS/configuration/krb5-conf.xml|  7 ---
 .../server/controller/KerberosHelperTest.java   | 20 --
 .../python/stacks/2.2/KERBEROS/use_cases.py | 16 ++
 .../journalnode-upgrade-hdfs-secure.json|  8 +++
 .../stacks/2.2/configs/journalnode-upgrade.json |  6 +++---
 .../wizard/stack/hdp/version2.0.1/KERBEROS.json |  2 +-
 ambari-web/app/data/HDP2/site_properties.js |  2 +-
 10 files changed, 44 insertions(+), 54 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b9c9832c/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
index ce319e6..2481f32 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
@@ -705,18 +705,18 @@ public class KerberosHelper {
 
 KDCType kdcType = null;
 String kdcTypeProperty = kerberosEnvProperties.get("kdc_type");
-if (kdcTypeProperty == null) {
-  // TODO: (rlevas) Only pull from kerberos-env, this is only for 
transitional purposes (AMBARI 9121)
-  kdcTypeProperty = krb5ConfProperties.get("kdc_type");
+if(kdcTypeProperty == null) {
+  String message = "The 'kerberos-env/kdc_type' value must be set to a 
valid KDC type";
+  LOG.error(message);
+  throw new IllegalArgumentException(message);
 }
-if (kdcTypeProperty != null) {
-  try {
-kdcType = KDCType.translate(kdcTypeProperty);
-  } catch (IllegalArgumentException e) {
-String message = String.format("Invalid 'kdc_type' value: %s", 
kdcTypeProperty);
-LOG.error(message);
-throw new AmbariException(message);
-  }
+
+try {
+  kdcType = KDCType.translate(kdcTypeProperty);
+} catch (IllegalArgumentException e) {
+  String message = String.format("Invalid 'kdc_type' value: %s", 
kdcTypeProperty);
+  LOG.error(message);
+  throw new AmbariException(message);
 }
 
 kerberosDetails.setSecurityType(cluster.getSecurityType());

http://git-wip-us.apache.org/repos/asf/ambari/blob/b9c9832c/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml
 
b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml
index 03b13d6..74b6f71 100644
--- 
a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml
+++ 
b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/kerberos-env.xml
@@ -22,6 +22,14 @@
 
 
   
+kdc_type
+
+  The type of KDC being used. Either mit-kdc or active-directory
+
+mit-kdc
+  
+
+  
 ldap_url
 
   The URL to the Active Directory LDAP Interface

http://git-wip-us.apache.org/repos/asf/ambari/blob/b9c9832c/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml
 
b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml
index 38f6ab2..3a2c81f 100644
--- 
a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml
+++ 
b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/configuration/krb5-conf.xml
@@ -114,13 +114,6 @@
 
   
   
-kdc_type
-
-  The type 

ambari git commit: AMBARI-9576 - LDAP Sync: Port and Protocol hard coded /usr/sbin/ambari-server.py (tbeerbower)

2015-02-11 Thread tbeerbower
Repository: ambari
Updated Branches:
  refs/heads/trunk 88ae3af0f -> 52250d5e1


AMBARI-9576 - LDAP Sync: Port and Protocol hard coded 
/usr/sbin/ambari-server.py (tbeerbower)


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

Branch: refs/heads/trunk
Commit: 52250d5e1df7e8b873e880f100ee59e52b3663ec
Parents: 88ae3af
Author: tbeerbower 
Authored: Wed Feb 11 15:09:49 2015 -0500
Committer: tbeerbower 
Committed: Wed Feb 11 17:20:35 2015 -0500

--
 ambari-server/src/main/python/ambari-server.py  |   8 +-
 .../python/ambari_server/serverConfiguration.py |   5 +
 .../src/main/python/ambari_server/setupHttps.py |   4 +-
 .../main/python/ambari_server/setupSecurity.py  |  33 -
 .../src/test/python/TestAmbariServer.py | 142 +++
 5 files changed, 179 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/52250d5e/ambari-server/src/main/python/ambari-server.py
--
diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index 3c4c9c7..5e51a6d 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -336,13 +336,13 @@ def init_parser_options(parser):
 help="Start ambari-server in debug mode")
   parser.add_option('-y', '--suspend-start', action="store_true", 
dest='suspend_start', default=False,
 help="Freeze ambari-server Java process at startup in 
debug mode")
-  parser.add_option('--all', action="store_true", default=False, help="LDAP 
sync all Ambari users and groups",
+  parser.add_option('--all', action="store_true", default=False, help="LDAP 
sync all option.  Synchronize all LDAP users and groups.",
 dest="ldap_sync_all")
   parser.add_option('--existing', action="store_true", default=False,
-help="LDAP sync existing Ambari users and groups only", 
dest="ldap_sync_existing")
-  parser.add_option('--users', default=None, help="Specifies the path to the 
LDAP sync users CSV file.",
+help="LDAP sync existing option.  Synchronize existing 
Ambari users and groups only.", dest="ldap_sync_existing")
+  parser.add_option('--users', default=None, help="LDAP sync users option. 
Specifies the path to a CSV file of user names to be synchronized.",
 dest="ldap_sync_users")
-  parser.add_option('--groups', default=None, help="Specifies the path to the 
LDAP sync groups CSV file.",
+  parser.add_option('--groups', default=None, help="LDAP sync groups option.  
Specifies the path to a CSV file of group names to be synchronized.",
 dest="ldap_sync_groups")
   parser.add_option('--database', default=None, help="Database to use 
embedded|oracle|mysql|postgres", dest="dbms")
   parser.add_option('--databasehost', default=None, help="Hostname of database 
server", dest="database_host")

http://git-wip-us.apache.org/repos/asf/ambari/blob/52250d5e/ambari-server/src/main/python/ambari_server/serverConfiguration.py
--
diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py 
b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
index aeb2b6c..035bdb3 100644
--- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -156,6 +156,11 @@ SSL_TRUSTSTORE_PATH_PROPERTY = "ssl.trustStore.path"
 SSL_TRUSTSTORE_PASSWORD_PROPERTY = "ssl.trustStore.password"
 SSL_TRUSTSTORE_TYPE_PROPERTY = "ssl.trustStore.type"
 
+# SSL common
+SSL_API = 'api.ssl'
+SSL_API_PORT = 'client.api.ssl.port'
+DEFAULT_SSL_API_PORT = 8443
+
 # JDK
 JDK_RELEASES="java.releases"
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/52250d5e/ambari-server/src/main/python/ambari_server/setupHttps.py
--
diff --git a/ambari-server/src/main/python/ambari_server/setupHttps.py 
b/ambari-server/src/main/python/ambari_server/setupHttps.py
index 6ec9978..1b803a5 100644
--- a/ambari-server/src/main/python/ambari_server/setupHttps.py
+++ b/ambari-server/src/main/python/ambari_server/setupHttps.py
@@ -33,6 +33,7 @@ from ambari_commons.os_utils import is_root, run_os_command, 
copy_file, set_file
 from ambari_server.serverConfiguration import get_ambari_properties, 
find_properties_file, read_ambari_user, \
 SSL_TRUSTSTORE_PASSWORD_PROPERTY, get_is_secure, 
decrypt_password_for_alias, SSL_TRUSTSTORE_PASSWORD_

ambari git commit: AMBARI-9582. Ambari Trunk is broken with multiple test failures (dlysnichenko)

2015-02-11 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 4a25974b1 -> 88ae3af0f


AMBARI-9582. Ambari Trunk is broken with multiple test failures (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 88ae3af0fd2156d8798858f0900b9f511159cb6b
Parents: 4a25974
Author: Lisnichenko Dmitro 
Authored: Wed Feb 11 23:04:03 2015 +0200
Committer: Lisnichenko Dmitro 
Committed: Wed Feb 11 23:04:03 2015 +0200

--
 .../python/ambari_server/dbConfiguration_linux.py   |  4 ++--
 ambari-server/src/test/python/TestAmbariServer.py   | 16 +---
 .../test/python/host_scripts/TestAlertDiskSpace.py  |  1 +
 3 files changed, 8 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/88ae3af0/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
--
diff --git 
a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py 
b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
index b2d1372..c92fd9c 100644
--- a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
+++ b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
@@ -34,7 +34,7 @@ from ambari_commons.os_utils import copy_files, find_in_path, 
is_root, remove_fi
 from ambari_server.dbConfiguration import DBMSConfig, USERNAME_PATTERN, 
SETUP_DB_CONNECT_ATTEMPTS, \
 SETUP_DB_CONNECT_TIMEOUT, STORAGE_TYPE_LOCAL, DEFAULT_USERNAME, 
DEFAULT_PASSWORD
 from ambari_server.serverConfiguration import get_ambari_properties, 
get_value_from_properties, configDefaults, \
-OS_TYPE, AMBARI_PROPERTIES_FILE, RESOURCES_DIR_PROPERTY, \
+OS_TYPE, OS_FAMILY, AMBARI_PROPERTIES_FILE, RESOURCES_DIR_PROPERTY, \
 JDBC_DATABASE_PROPERTY, JDBC_DATABASE_NAME_PROPERTY, 
JDBC_POSTGRES_SCHEMA_PROPERTY, \
 JDBC_HOSTNAME_PROPERTY, JDBC_PORT_PROPERTY, \
 JDBC_USER_NAME_PROPERTY, JDBC_PASSWORD_PROPERTY, JDBC_PASSWORD_FILENAME, \
@@ -351,7 +351,7 @@ class PGConfig(LinuxDBMSConfig):
 
 if self.persistence_type == STORAGE_TYPE_LOCAL:
   PGConfig.PG_STATUS_RUNNING = get_postgre_running_status(OS_TYPE)
-  PGConfig.PG_HBA_DIR = get_postgre_hba_dir(OSCheck.get_os_family())
+  PGConfig.PG_HBA_DIR = get_postgre_hba_dir(OS_FAMILY)
 
   PGConfig.PG_HBA_CONF_FILE = os.path.join(PGConfig.PG_HBA_DIR, 
"pg_hba.conf")
   PGConfig.PG_HBA_CONF_FILE_BACKUP = os.path.join(PGConfig.PG_HBA_DIR, 
"pg_hba_bak.conf.old")

http://git-wip-us.apache.org/repos/asf/ambari/blob/88ae3af0/ambari-server/src/test/python/TestAmbariServer.py
--
diff --git a/ambari-server/src/test/python/TestAmbariServer.py 
b/ambari-server/src/test/python/TestAmbariServer.py
index 825991b..5c9d8ff 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -92,6 +92,8 @@ with patch("platform.linux_distribution", return_value = 
os_distro_value):
 
 CURR_AMBARI_VERSION = "2.0.0"
 
+@patch("ambari_server.dbConfiguration_linux.get_postgre_hba_dir", new = 
MagicMock(return_value = "/var/lib/pgsql/data"))
+@patch("ambari_server.dbConfiguration_linux.get_postgre_running_status", new = 
MagicMock(return_value = "running"))
 class TestAmbariServer(TestCase):
   def setUp(self):
 out = StringIO.StringIO()
@@ -2806,9 +2808,7 @@ 
MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
   @patch("ambari_server.serverSetup.adjust_directory_permissions")
   @patch("ambari_server.serverSetup.read_ambari_user")
   @patch("ambari_server.serverSetup.expand_jce_zip_file")
-  @patch("ambari_server.dbConfiguration_linux.get_postgre_hba_dir")
-  @patch("ambari_server.dbConfiguration_linux.get_postgre_running_status")
-  def test_setup(self, get_postgre_running_status_mock, 
get_postgre_hba_dir_mock, expand_jce_zip_file_mock,
+  def test_setup(self, expand_jce_zip_file_mock,
  read_ambari_user_mock, adjust_dirs_mock, extract_views_mock, 
proceedJDBCProperties_mock, is_root_mock,
  disable_security_enhancements_mock, check_jdbc_drivers_mock, 
check_ambari_user_mock,
  download_jdk_mock, configure_os_settings_mock, 
get_ambari_properties_mock,
@@ -3238,10 +3238,7 @@ 
MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
   @patch("getpass.getuser")
   @patch("os.chdir")
   @patch.object(ResourceFilesKeeper, "perform_housekeeping")
-  @patch("ambari_server.dbConfiguration_linux.get_postgre_hba_dir")
-  @patch("ambari_server.dbConfiguration_linux.get_postgre_running_status")
-  d

ambari git commit: AMBARI-9581. curl unable to connect to Ambari when SSLv3 and TLSv1 is disabled (aonishuk)

2015-02-11 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk a5e43551d -> 4a25974b1


AMBARI-9581. curl unable to connect to Ambari when SSLv3 and TLSv1 is disabled 
(aonishuk)


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

Branch: refs/heads/trunk
Commit: 4a25974b195aadb6ff12534e383e72b4aae6c5fb
Parents: a5e4355
Author: Andrew Onishuk 
Authored: Wed Feb 11 22:51:29 2015 +0200
Committer: Andrew Onishuk 
Committed: Wed Feb 11 22:51:29 2015 +0200

--
 .../ambari_agent/AlertSchedulerHandler.py   |  5 +-
 .../src/main/python/ambari_agent/Controller.py  |  2 +-
 .../python/ambari_agent/alerts/script_alert.py  |  5 +-
 .../resource_management/core/constants.py   | 34 --
 .../resource_management/core/environment.py |  9 +--
 .../python/resource_management/core/source.py   | 71 +---
 .../libraries/functions/__init__.py |  1 +
 .../libraries/functions/constants.py| 36 ++
 .../libraries/script/__init__.py|  2 +-
 .../libraries/script/script.py  |  3 +-
 .../package/scripts/setup_ranger_hbase.py   | 12 +---
 .../package/scripts/namenode_upgrade.py |  2 +-
 .../package/scripts/setup_ranger_hdfs.py| 12 +---
 .../HIVE/0.12.0.2.0/package/scripts/hive.py | 27 ++--
 .../package/scripts/setup_ranger_hive.py| 12 +---
 .../package/scripts/setup_ranger_knox.py| 12 +---
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py| 26 ++-
 .../package/scripts/oozie_server_upgrade.py |  2 +-
 .../0.4.0/package/scripts/setup_ranger.py   | 12 +---
 .../package/scripts/setup_ranger_storm.py   | 12 +---
 .../before-ANY/scripts/shared_initialization.py | 17 ++---
 .../scripts/shared_initialization.py| 16 ++---
 .../scripts/shared_initialization.py| 23 +++
 .../stacks/2.0.6/HIVE/test_hive_client.py   | 10 ++-
 .../stacks/2.0.6/HIVE/test_hive_metastore.py| 14 ++--
 .../stacks/2.0.6/HIVE/test_hive_server.py   | 14 ++--
 .../2.0.6/hooks/before-ANY/test_before_any.py   | 10 +--
 .../hooks/before-INSTALL/test_before_install.py | 11 +--
 .../stacks/2.1/HIVE/test_hive_metastore.py  | 14 ++--
 .../src/test/python/stacks/utils/RMFTestCase.py | 11 ++-
 30 files changed, 190 insertions(+), 247 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4a25974b/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py 
b/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py
index 66b1758..87295d2 100644
--- a/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py
+++ b/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py
@@ -53,7 +53,7 @@ class AlertSchedulerHandler():
   }
 
 
-  def __init__(self, cachedir, stacks_dir, common_services_dir, 
host_scripts_dir, in_minutes=True):
+  def __init__(self, cachedir, stacks_dir, common_services_dir, 
host_scripts_dir, config, in_minutes=True):
 self.cachedir = cachedir
 self.stacks_dir = stacks_dir
 self.common_services_dir = common_services_dir
@@ -69,6 +69,7 @@ class AlertSchedulerHandler():
 self._collector = AlertCollector()
 self.__scheduler = Scheduler(AlertSchedulerHandler.APS_CONFIG)
 self.__in_minutes = in_minutes
+self.config = config
 self.__config_maps = {}
 
 
@@ -281,7 +282,7 @@ class AlertSchedulerHandler():
   source['stacks_directory'] = self.stacks_dir
   source['common_services_directory'] = self.common_services_dir
   source['host_scripts_directory'] = self.host_scripts_dir
-  alert = ScriptAlert(json_definition, source)
+  alert = ScriptAlert(json_definition, source, self.config)
 elif source_type == AlertSchedulerHandler.TYPE_WEB:
   alert = WebAlert(json_definition, source)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4a25974b/ambari-agent/src/main/python/ambari_agent/Controller.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/Controller.py 
b/ambari-agent/src/main/python/ambari_agent/Controller.py
index f8a9f04..d597bca 100644
--- a/ambari-agent/src/main/python/ambari_agent/Controller.py
+++ b/ambari-agent/src/main/python/ambari_agent/Controller.py
@@ -91,7 +91,7 @@ class Controller(threading.Thread):
 alerts_cache_dir = os.path.join(cache_dir, 'alerts')
 
 self.alert_scheduler_handler = AlertSchedulerHandler(alerts_cache_dir, 
-stacks_cache_dir, common_services_cache_dir, host_s

ambari git commit: AMBARI-9561. Stack advisor for Hive reports incorrect warning when trying to add Ranger service. (yusaku)

2015-02-11 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk 032bbd760 -> a5e43551d


AMBARI-9561. Stack advisor for Hive reports incorrect warning when trying to 
add Ranger service. (yusaku)


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

Branch: refs/heads/trunk
Commit: a5e43551d8e410f7128fb02b66bf126173ca25e0
Parents: 032bbd7
Author: Yusaku Sako 
Authored: Wed Feb 11 11:42:02 2015 -0800
Committer: Yusaku Sako 
Committed: Wed Feb 11 11:42:18 2015 -0800

--
 .../stacks/HDP/2.2/services/stack_advisor.py| 62 
 1 file changed, 49 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a5e43551/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
index 2bdbce7..e805269 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
@@ -65,8 +65,8 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
   putHiveProperty("hive.security.authenticator.manager", 
'org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator')
 elif (rangerPluginEnabled.lower() == "No".lower()):
   putHiveProperty = self.putProperty(configurations, 
"hiveserver2-site")
-  putHiveProperty("hive.security.authorization.manager", 
'org.apache.hadoop.hive.ql.security.authorization.DefaultHiveAuthorizationProvider')
-  putHiveProperty("hive.security.authenticator.manager", 
'org.apache.hadoop.hive.ql.security.HadoopDefaultAuthenticator')
+  putHiveProperty("hive.security.authorization.manager", 
'org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory')
+  putHiveProperty("hive.security.authenticator.manager", 
'org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator')
 
   def recommendHBASEConfigurations(self, configurations, clusterData, 
services, hosts):
 super(HDP22StackAdvisor, 
self).recommendHbaseEnvConfigurations(configurations, clusterData, services, 
hosts)
@@ -96,7 +96,7 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
 childValidators = {
   "HDFS": {"hdfs-site": self.validateHDFSConfigurations,
"hadoop-env": self.validateHDFSConfigurationsEnv},
-  "HIVE": {"hiveserver2-site": self.validateHIVEConfigurations},
+  "HIVE": {"hiveserver2-site": self.validateHiveServer2Configurations, 
"hive-site": self.validateHiveConfigurations},
   "HBASE": {"hbase-site": self.validateHBASEConfigurations},
   "MAPREDUCE2": {"mapred-site": self.validateMapReduce2Configurations},
   "TEZ": {"tez-site": self.validateTezConfigurations}
@@ -253,7 +253,7 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
   data_transfer_protection_value, 
VALID_TRANSFER_PROTECTION_VALUES))})
 return self.toConfigurationValidationProblems(validationItems, "hdfs-site")
 
-  def validateHIVEConfigurations(self, properties, recommendedDefaults, 
configurations, services, hosts):
+  def validateHiveServer2Configurations(self, properties, recommendedDefaults, 
configurations, services, hosts):
 super(HDP22StackAdvisor, self).validateHiveConfigurations(properties, 
recommendedDefaults, configurations, services, hosts)
 hive_server2 = properties
 validationItems = [] 
@@ -270,33 +270,69 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
 if hive_server2[prop_name] != prop_val:
   validationItems.append({"config-name": prop_name,
   "item": self.getWarnItem(
-  "If Ranger HIVE Plugin is enabled."\
+  "If Ranger Hive Plugin is enabled."\
   " {0} needs to be set to 
{1}".format(prop_name,prop_val))})
 prop_name = 'hive.security.authenticator.manager'
 prop_val = 
"org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator"
 if hive_server2[prop_name] != prop_val:
   validationItems.append({"config-name": prop_name,
   "item": self.getWarnItem(
-  "If Ranger HIVE Plugin is enabled."\
+  "If Ranger Hive Plugin is enabled."\
   " {0} needs to be set to 
{1}".format(prop_name,prop_val))})
   ##Add stack validations for  Ranger plugin dis

[2/2] ambari git commit: AMBARI-9529 Ambari view - View iframe pointing to invalid link when ambari url contains query parameters. (atkach)

2015-02-11 Thread atkach
AMBARI-9529 Ambari view - View iframe pointing to invalid link when ambari url 
contains query parameters. (atkach)


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

Branch: refs/heads/trunk
Commit: 032bbd760fb4dae566734779f1b658a0ffcc
Parents: 143f381
Author: Andrii Tkach 
Authored: Wed Feb 11 21:32:56 2015 +0200
Committer: Andrii Tkach 
Committed: Wed Feb 11 21:34:11 2015 +0200

--
 ambari-web/app/assets/test/tests.js|  1 +
 ambari-web/app/routes/views.js | 33 +++-
 ambari-web/app/views/main/views/details.js |  2 +-
 ambari-web/test/routes/views_test.js   | 50 +
 4 files changed, 83 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/032bbd76/ambari-web/app/assets/test/tests.js
--
diff --git a/ambari-web/app/assets/test/tests.js 
b/ambari-web/app/assets/test/tests.js
index 454fd8d..cd0dc1d 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -255,6 +255,7 @@ var files = ['test/init_model_test',
   'test/models/user_test',
   'test/models/host_stack_version_test',
   'test/models/upgrade_entity_test',
+  'test/routes/views_test',
   //contains test with fake timers that affect Date
   'test/utils/lazy_loading_test'
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/032bbd76/ambari-web/app/routes/views.js
--
diff --git a/ambari-web/app/routes/views.js b/ambari-web/app/routes/views.js
index b0e2f15..68ba817 100644
--- a/ambari-web/app/routes/views.js
+++ b/ambari-web/app/routes/views.js
@@ -35,10 +35,39 @@ module.exports = Em.Route.extend({
 route: '/:viewName/:version/:instanceName',
 connectOutlets: function (router, params) {
   // find and set content for `mainViewsDetails` and associated controller
+
+  var href = ['/views', params.viewName, params.version, 
params.instanceName].join('/');
+  var viewPath = this.parseViewPath(params.instanceName);
+  if (viewPath) {
+href = ['/views', params.viewName, params.version, 
params.instanceName.slice(0, params.instanceName.lastIndexOf('?'))].join('/');
+  }
+
   router.get('mainViewsController').dataLoading().done(function() {
-router.get('mainController').connectOutlet('mainViewsDetails', 
App.router.get('mainViewsController.ambariViews')
-  .findProperty('href', ['/views', params.viewName, params.version, 
params.instanceName].join('/')));
+var content = 
App.router.get('mainViewsController.ambariViews').findProperty('href', href);
+if (content) content.set('viewPath', viewPath);
+router.get('mainController').connectOutlet('mainViewsDetails', 
content);
   });
+},
+/**
+ * parse internal view path
+ * "viewPath" - used as a key of additional path
+ * Example:
+ *   origin URL: 
viewName?viewPath=%2Fuser%2Fadmin%2Faddress&foo=bar&count=1
+ * should be translated to
+ *   view path: /user/admin/address?foo=bar&count=1
+ *
+ * @param {string} instanceName
+ * @returns {string}
+ */
+parseViewPath: function (instanceName) {
+  var path = '';
+  if (instanceName.contains('?')) {
+path = instanceName.slice(instanceName.indexOf('?'));
+if (path.contains('viewPath')) {
+  path = decodeURIComponent(path.slice((path.lastIndexOf('?viewPath=') 
+ 10))).replace('&', '?');
+}
+  }
+  return path;
 }
   })
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/032bbd76/ambari-web/app/views/main/views/details.js
--
diff --git a/ambari-web/app/views/main/views/details.js 
b/ambari-web/app/views/main/views/details.js
index 453724c..e90cb20 100644
--- a/ambari-web/app/views/main/views/details.js
+++ b/ambari-web/app/views/main/views/details.js
@@ -87,7 +87,7 @@ App.MainViewsDetailsView = Em.View.extend({
 
   src: function() {
 // can't use window.location.origin because IE doesn't support it
-return window.location.protocol + '//' + window.location.host + 
this.get('controller.content.href');
+return window.location.protocol + '//' + window.location.host + 
this.get('controller.content.href') + this.get('controller.content.viewPath');
   }.property('controller.content')
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/032bbd76/ambari-web/test/routes/views_test.js
--
diff --git a/ambari-web/test/routes/views_test.js 

[1/2] ambari git commit: AMBARI-9575 RU: UI clean up (FE changes). (atkach)

2015-02-11 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk ca074d01f -> 032bbd760


AMBARI-9575 RU: UI clean up (FE changes). (atkach)


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

Branch: refs/heads/trunk
Commit: 143f38144fc59c2a8776118cb3d2d10ca2807f92
Parents: ca074d0
Author: Andrii Tkach 
Authored: Wed Feb 11 20:05:09 2015 +0200
Committer: Andrii Tkach 
Committed: Wed Feb 11 21:34:10 2015 +0200

--
 ambari-web/app/messages.js   | 2 +-
 .../main/admin/stack_upgrade/stack_upgrade_wizard.hbs| 8 
 2 files changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/143f3814/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 9e1a61d..8d8b973 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1318,7 +1318,7 @@ Em.I18n.translations = {
   'admin.stackUpgrade.doThisLater': "Do This Later",
   'admin.stackUpgrade.pauseUpgrade': "Pause Upgrade",
   'admin.stackUpgrade.downgrade.proceed': "Proceed with Downgrade",
-  'admin.stackUpgrade.downgrade.body': "Are you sure you wish to abort the 
upgrade process and downgrade to {0}",
+  'admin.stackUpgrade.downgrade.body': "Are you sure you wish to abort the 
upgrade process and downgrade to {0}?",
   'admin.stackUpgrade.upgrade.confirm.body': "You are about to perform an 
upgrade to {0}.",
   'admin.stackUpgrade.title': "Stack and Versions",
   'admin.stackUpgrade.state.inProgress': "Upgrade in Progress",

http://git-wip-us.apache.org/repos/asf/ambari/blob/143f3814/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs
--
diff --git 
a/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs 
b/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs
index afd6970..5a6151e 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/stack_upgrade_wizard.hbs
@@ -85,10 +85,10 @@
 {{t admin.stackUpgrade.finalize.message.upgrade}}
   {{/if}}
 
-  
+  
 {{view Em.Checkbox checkedBinding="view.isManualDone"}}
 {{t admin.stackUpgrade.dialog.manualDone}}
-  
+  
   
 {{#if view.isDowngradeAvailable}}
   {{t common.downgrade}}
@@ -104,10 +104,10 @@
   {{t admin.stackUpgrade.dialog.manual}}
   {{view.manualItem.text}}
 
-  
+  
 {{view Em.Checkbox checkedBinding="view.isManualDone"}}
 {{t admin.stackUpgrade.dialog.manualDone}}
-  
+  
   
 {{#if view.isDowngradeAvailable}}
   {{t common.downgrade}}



ambari git commit: AMBARI-9559. RU: Finalize fails because Secondary Namenode was not deleted during HA Wizard (alejandro)

2015-02-11 Thread alejandro
Repository: ambari
Updated Branches:
  refs/heads/trunk fe2122c72 -> ca074d01f


AMBARI-9559. RU: Finalize fails because Secondary Namenode was not deleted 
during HA Wizard (alejandro)


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

Branch: refs/heads/trunk
Commit: ca074d01f834740cf7a81c227a5528b961cd41d3
Parents: fe2122c
Author: Alejandro Fernandez 
Authored: Tue Feb 10 15:35:33 2015 -0800
Committer: Alejandro Fernandez 
Committed: Wed Feb 11 11:21:24 2015 -0800

--
 .../checks/SecondaryNamenodeDeletedCheck.java   | 66 
 .../PreUpgradeCheckResourceProvider.java| 15 -
 .../ambari/server/stack/MasterHostResolver.java |  2 +-
 3 files changed, 81 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ca074d01/ambari-server/src/main/java/org/apache/ambari/server/checks/SecondaryNamenodeDeletedCheck.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/SecondaryNamenodeDeletedCheck.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/SecondaryNamenodeDeletedCheck.java
new file mode 100644
index 000..ad967f8
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/SecondaryNamenodeDeletedCheck.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.checks;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.PrereqCheckRequest;
+import org.apache.ambari.server.stack.MasterHostResolver;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.ServiceComponent;
+import org.apache.ambari.server.state.stack.PrereqCheckStatus;
+import org.apache.ambari.server.state.stack.PrereqCheckType;
+import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.Set;
+
+/**
+ * Checks that the Secondary NameNode is not present on any of the hosts.
+ */
+public class SecondaryNamenodeDeletedCheck extends AbstractCheckDescriptor {
+
+  /**
+   * Constructor.
+   */
+  public SecondaryNamenodeDeletedCheck() {
+super("SECONDARY_NAMENODE_MUST_BE_DELETED", PrereqCheckType.SERVICE, "The 
SECONDARY_NAMENODE component must be deleted from all hosts");
+  }
+
+  @Override
+  public boolean isApplicable(PrereqCheckRequest request) throws 
AmbariException {
+final Cluster cluster = 
clustersProvider.get().getCluster(request.getClusterName());
+return cluster.getService(MasterHostResolver.Service.HDFS.name()) != null;
+  }
+
+  @Override
+  public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest 
request) throws AmbariException {
+final String clusterName = request.getClusterName();
+
+final Cluster cluster = clustersProvider.get().getCluster(clusterName);
+ServiceComponent serviceComponent = 
cluster.getService(MasterHostResolver.Service.HDFS.name()).getServiceComponent("SECONDARY_NAMENODE");
+if (serviceComponent !=  null) {
+  Set hosts = serviceComponent.getServiceComponentHosts().keySet();
+
+  if (!hosts.isEmpty()) {
+prerequisiteCheck.getFailedOn().add(serviceComponent.getName());
+prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
+prerequisiteCheck.setFailReason("The SECONDARY_NAMENODE component must 
be deleted from host(s): " + StringUtils.join(hosts, ", ") + ". Please use the 
REST API to delete it.");
+  }
+}
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ca074d01/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeCheckResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PreUpgradeC

ambari git commit: AMBARI-9577. RU - Repo version on all hosts are set to "Out of Sync" after adding Storm (dlysnichenko)

2015-02-11 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk d248fd7c1 -> fe2122c72


AMBARI-9577. RU - Repo version on all hosts are set to "Out of Sync" after 
adding Storm (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: fe2122c72f1e2bd214f81b1eb326502bdcd7a43c
Parents: d248fd7
Author: Lisnichenko Dmitro 
Authored: Wed Feb 11 21:15:54 2015 +0200
Committer: Lisnichenko Dmitro 
Committed: Wed Feb 11 21:15:54 2015 +0200

--
 .../upgrade/HostVersionOutOfSyncListener.java   |  12 +-
 .../HostVersionOutOfSyncListenerTest.java   | 112 ++-
 2 files changed, 120 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fe2122c7/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
index f64272f..dcc06a7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListener.java
@@ -35,6 +35,7 @@ import 
org.apache.ambari.server.orm.entities.HostVersionEntity;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.RepositoryVersionState;
+import org.apache.ambari.server.state.ServiceComponent;
 import org.apache.ambari.server.state.StackId;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -42,6 +43,7 @@ import org.slf4j.LoggerFactory;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -111,7 +113,15 @@ public class HostVersionOutOfSyncListener {
   Cluster cluster = clusters.get().getClusterById(event.getClusterId());
   Set changedRepositoryVersions = new HashSet();
   StackId currentStackId = cluster.getCurrentStackVersion();
-  for (String hostName : 
clusters.get().getHostsForCluster(cluster.getClusterName()).keySet()) {
+  Map serviceComponents = 
cluster.getService(event.getServiceName()).getServiceComponents();
+  // Determine hosts that become OUT_OF_SYNC when adding components for 
new service
+  Set affectedHosts = new HashSet();
+  for (ServiceComponent component : serviceComponents.values()) {
+for (String hostname : component.getServiceComponentHosts().keySet()) {
+  affectedHosts.add(hostname);
+}
+  }
+  for (String hostName : affectedHosts) {
 List hostVersionEntities =
 
hostVersionDAO.get().findByClusterAndHost(cluster.getClusterName(), hostName);
 for (HostVersionEntity hostVersionEntity : hostVersionEntities) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/fe2122c7/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
index 632a2b8..f2417bd 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
@@ -24,10 +24,15 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.mockito.Mockito.mock;
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import javax.persistence.RollbackException;
 
@@ -51,6 +56,9 @@ import org.apache.ambari.server.state.RepositoryVersionState;
 import org.apache.ambari.server.state.Clusters;
 import org.apache.ambari.server.state.Host;
 import org.apache.ambari.server.state.HostState;
+import org.apache.ambari.server.state.Service;
+import org.apache.ambari.server.state.ServiceComponent;
+import org.apache.ambari.server.state.Service

ambari git commit: AMBARI-9405. RU YARN related pre-upgrade check UI shows unclear message (yshylov via dlysnichenko)

2015-02-11 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk fad54e324 -> d248fd7c1


AMBARI-9405. RU YARN related pre-upgrade check UI shows unclear message 
(yshylov via dlysnichenko)


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

Branch: refs/heads/trunk
Commit: d248fd7c150db9e827fe5f1b837c43d89e6fef08
Parents: fad54e3
Author: Lisnichenko Dmitro 
Authored: Wed Feb 11 21:10:22 2015 +0200
Committer: Lisnichenko Dmitro 
Committed: Wed Feb 11 21:10:22 2015 +0200

--
 .../server/checks/AbstractCheckDescriptor.java  | 39 --
 .../server/checks/HostsHeartbeatCheck.java  |  2 +-
 .../checks/HostsMasterMaintenanceCheck.java |  2 +-
 .../checks/HostsRepositoryVersionCheck.java |  3 +-
 .../checks/ServicesDecommissionCheck.java   |  2 +-
 .../checks/ServicesMaintenanceModeCheck.java|  2 +-
 .../ServicesNamenodeHighAvailabilityCheck.java  |  2 +-
 .../ambari/server/checks/ServicesUpCheck.java   |  2 +-
 .../checks/ServicesYarnWorkPreservingCheck.java |  3 +-
 .../server/api/services/GroupServiceTest.java   |  1 +
 .../checks/AbstractCheckDescriptorTest.java | 76 
 11 files changed, 121 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d248fd7c/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
index 4e2e2ab..c43d843 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
@@ -17,8 +17,7 @@
  */
 package org.apache.ambari.server.checks;
 
-import com.google.inject.Inject;
-import com.google.inject.Provider;
+import java.util.List;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
@@ -26,9 +25,13 @@ import 
org.apache.ambari.server.controller.PrereqCheckRequest;
 import org.apache.ambari.server.orm.dao.HostVersionDAO;
 import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
 import org.apache.ambari.server.state.Clusters;
-import org.apache.ambari.server.state.stack.PrerequisiteCheck;
 import org.apache.ambari.server.state.stack.PrereqCheckType;
+import org.apache.ambari.server.state.stack.PrerequisiteCheck;
 import org.apache.ambari.server.state.stack.upgrade.RepositoryVersionHelper;
+import org.apache.commons.lang.StringUtils;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
 
 /**
  * Describes prerequisite check.
@@ -88,4 +91,32 @@ public abstract class AbstractCheckDescriptor {
* @throws AmbariException if server error happens
*/
   public abstract void perform(PrerequisiteCheck prerequisiteCheck, 
PrereqCheckRequest request) throws AmbariException;
-}
\ No newline at end of file
+
+  /**
+   * Formats lists of given entities to human readable form:
+   * [entity1] -> {entity1} {noun}
+   * [entity1, entity2] -> {entity1} and {entity2} {noun}s
+   * [entity1, entity2, entity3] -> {entity1}, {entity2} and {entity3} {noun}s
+   * The noun for the entities is taken from check type, it may be cluster, 
service or host.
+   *
+   * @param entities list of entities to format
+   * @return formatted entity list
+   */
+  protected String formatEntityList(List entities) {
+if (entities == null || entities.isEmpty()) {
+  return "";
+}
+final StringBuilder formatted = new 
StringBuilder(StringUtils.join(entities, ", "));
+if (entities.size() > 1) {
+  formatted.replace(formatted.lastIndexOf(","), formatted.lastIndexOf(",") 
+ 1, " and");
+}
+if (type != null) {
+  formatted.append(" ").append(type.name().toLowerCase());
+  if (entities.size() > 1) {
+formatted.append("s");
+  }
+}
+return formatted.toString();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/d248fd7c/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsHeartbeatCheck.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsHeartbeatCheck.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsHeartbeatCheck.java
index 917cbac..9e76928 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsHeartbeatCheck.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/

ambari git commit: AMBARI-9579. After upgrading Ambari 1.6.1 to 1.7, the directory of zookeeper server get changed to /hadoop/zookeeper (dlysnichenko)

2015-02-11 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk a49bc274e -> fad54e324


AMBARI-9579. After upgrading Ambari 1.6.1 to 1.7, the directory of zookeeper 
server get changed to /hadoop/zookeeper (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: fad54e324da628568b3a6aad3243ce36a62a3894
Parents: a49bc27
Author: Lisnichenko Dmitro 
Authored: Wed Feb 11 21:05:04 2015 +0200
Committer: Lisnichenko Dmitro 
Committed: Wed Feb 11 21:05:04 2015 +0200

--
 .../ambari/server/upgrade/UpgradeCatalog170.java  | 14 +++---
 .../ambari/server/upgrade/UpgradeCatalog170Test.java  |  7 +--
 2 files changed, 16 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fad54e32/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
index a7736dd..47f4587 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
@@ -1178,6 +1178,7 @@ public class UpgradeCatalog170 extends 
AbstractUpgradeCatalog {
 for (Map.Entry property : globalProperites.entrySet()) 
{
   String propertyName = property.getKey();
   String propertyValue = property.getValue();
+  String newPropertyName = getNewPropertyName().get(propertyName);
 
   Set newConfigTypes = 
configHelper.findConfigTypesByPropertyName(cluster.getCurrentStackVersion(),
   propertyName, cluster.getClusterName());
@@ -1188,7 +1189,7 @@ public class UpgradeCatalog170 extends 
AbstractUpgradeCatalog {
   if(newConfigTypes.size() > 0) {
 newConfigType = newConfigTypes.iterator().next();
   } else {
-newConfigType = 
getAdditionalMappingGlobalToEnv().get(propertyName);
+newConfigType = 
getAdditionalMappingGlobalToEnv().get(((newPropertyName == null)? propertyName 
: newPropertyName));
   }
 
   if(newConfigType==null) {
@@ -1199,13 +1200,13 @@ public class UpgradeCatalog170 extends 
AbstractUpgradeCatalog {
   }
 
   LOG.info("Mapping config " + propertyName + " from " + 
Configuration.GLOBAL_CONFIG_TAG +
-  " to " + newConfigType +
+  " to " + ((newPropertyName == null)? propertyName : 
newPropertyName) + " property in " + newConfigType +
   " (value="+propertyValue+")");
 
   if(!newProperties.containsKey(newConfigType)) {
 newProperties.put(newConfigType, new HashMap());
   }
-  newProperties.get(newConfigType).put(propertyName, propertyValue);
+  newProperties.get(newConfigType).put(((newPropertyName == null)? 
propertyName : newPropertyName), propertyValue);
 }
 
 for (Entry> newProperty : 
newProperties.entrySet()) {
@@ -1243,10 +1244,17 @@ public class UpgradeCatalog170 extends 
AbstractUpgradeCatalog {
 result.put("storm_keytab","storm-env");
 result.put("hive_hostname","hive-env");
 result.put("oozie_hostname","oozie-env");
+result.put("dataDir","zoo.cfg");
 
 return result;
   }
 
+  public Map getNewPropertyName() {
+Map result = new HashMap();
+result.put("zk_data_dir","dataDir");
+return result;
+  }
+  
   private void upgradePermissionModel() throws SQLException {
 final UserDAO userDAO = injector.getInstance(UserDAO.class);
 final PrincipalDAO principalDAO = injector.getInstance(PrincipalDAO.class);

http://git-wip-us.apache.org/repos/asf/ambari/blob/fad54e32/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
index 42735c0..b51cac2 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
@@ -162,7 +162,7 @@ public class UpgradeCatalog170Test {
   }
 
   @Test
-  public void testExecuteDDLUpdates() throws Exception {
+  public void testExecuteDDLUpdates_DBAccessor() throws Exception {
 final DBAccessor dbAccessor = creat

ambari git commit: AMBARI-9498. RU: hosts master check is not checking all masters (yshylov via dlysnichenko)

2015-02-11 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk f36ffea7d -> a49bc274e


AMBARI-9498. RU: hosts master check is not checking all masters (yshylov via 
dlysnichenko)


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

Branch: refs/heads/trunk
Commit: a49bc274e142d62d74a80067c22b1283309f7976
Parents: f36ffea
Author: Lisnichenko Dmitro 
Authored: Wed Feb 11 21:00:25 2015 +0200
Committer: Lisnichenko Dmitro 
Committed: Wed Feb 11 21:00:25 2015 +0200

--
 .../server/checks/AbstractCheckDescriptor.java  | 14 +---
 .../checks/HostsMasterMaintenanceCheck.java | 38 ++--
 .../ambari/server/state/CheckHelperTest.java| 17 +
 3 files changed, 47 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a49bc274/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
index 647f2d1..4e2e2ab 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
@@ -19,15 +19,16 @@ package org.apache.ambari.server.checks;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
+
 import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.configuration.Configuration;
+import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.controller.PrereqCheckRequest;
 import org.apache.ambari.server.orm.dao.HostVersionDAO;
 import org.apache.ambari.server.orm.dao.RepositoryVersionDAO;
 import org.apache.ambari.server.state.Clusters;
-import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
 import org.apache.ambari.server.state.stack.PrereqCheckType;
+import org.apache.ambari.server.state.stack.upgrade.RepositoryVersionHelper;
 
 /**
  * Describes prerequisite check.
@@ -42,14 +43,17 @@ public abstract class AbstractCheckDescriptor {
   Provider clustersProvider;
 
   @Inject
-  Provider configHelperProvider;
-
-  @Inject
   Provider hostVersionDaoProvider;
 
   @Inject
   Provider repositoryVersionDaoProvider;
 
+  @Inject
+  Provider repositoryVersionHelper;
+
+  @Inject
+  Provider ambariMetaInfo;
+
   /**
* Constructor.
*

http://git-wip-us.apache.org/repos/asf/ambari/blob/a49bc274/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
index 91ca65a..f12b473 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
@@ -19,12 +19,12 @@ package org.apache.ambari.server.checks;
 
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.PrereqCheckRequest;
-import org.apache.ambari.server.stack.HostsType;
-import org.apache.ambari.server.stack.MasterHostResolver;
 import org.apache.ambari.server.state.*;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
 import org.apache.ambari.server.state.stack.PrereqCheckType;
+import org.apache.ambari.server.state.stack.UpgradePack;
+import org.apache.ambari.server.state.stack.UpgradePack.ProcessingComponent;
 
 import java.util.HashSet;
 import java.util.Map;
@@ -43,18 +43,36 @@ public class HostsMasterMaintenanceCheck extends 
AbstractCheckDescriptor {
   }
 
   @Override
+  public boolean isApplicable(PrereqCheckRequest request) throws 
AmbariException {
+return request.getRepositoryVersion() != null;
+  }
+
+  @Override
   public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest 
request) throws AmbariException {
 final String clusterName = request.getClusterName();
 final Cluster cluster = clustersProvider.get().getCluster(clusterName);
-final MasterHostResolver masterHostResolver = new 
MasterHostResolver(configHelperProvider.get(), cluster);
+final StackId stackId = cluster.getDesiredStackVersion();
 final Set

ambari git commit: AMBARI-9573. Ranger / Knox summary page layout is a bit off(alexantonenko)

2015-02-11 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 45a1cb14e -> f36ffea7d


AMBARI-9573. Ranger / Knox summary page layout is a bit off(alexantonenko)


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

Branch: refs/heads/trunk
Commit: f36ffea7de0c76406b62b959bce1697f9ce615ab
Parents: 45a1cb1
Author: Alex Antonenko 
Authored: Wed Feb 11 19:44:35 2015 +0200
Committer: Alex Antonenko 
Committed: Wed Feb 11 20:22:30 2015 +0200

--
 ambari-web/app/styles/application.less | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f36ffea7/ambari-web/app/styles/application.less
--
diff --git a/ambari-web/app/styles/application.less 
b/ambari-web/app/styles/application.less
index a7dc94d..a72a073 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -1922,14 +1922,11 @@ a:focus {
   tr.component-small {
 font-size: 11px;
   }
-  td.summary-label {
-width: 180px;
-text-align: right;
-  }
   .upgrade-status-warning {
 color: @health-status-orange;
   }
   tr td:first-child {
+width: 180px;
 text-align: right;
   }
   a {



ambari git commit: AMBARI-9560. Add hbase.rpc.protection to HBase stack definition. (yusaku)

2015-02-11 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk 1d6379345 -> 45a1cb14e


AMBARI-9560. Add hbase.rpc.protection to HBase stack definition. (yusaku)


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

Branch: refs/heads/trunk
Commit: 45a1cb14e2025b4c01aa9d8b0b019f3d9d1da66f
Parents: 1d63793
Author: Yusaku Sako 
Authored: Tue Feb 10 17:08:21 2015 -0800
Committer: Yusaku Sako 
Committed: Wed Feb 11 10:09:31 2015 -0800

--
 .../HBASE/0.96.0.2.0/configuration/hbase-site.xml   | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/45a1cb14/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/configuration/hbase-site.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/configuration/hbase-site.xml
 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/configuration/hbase-site.xml
index 84900d1..0cdabf4 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/configuration/hbase-site.xml
+++ 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/configuration/hbase-site.xml
@@ -328,4 +328,9 @@
 Path to domain socket.
   
 
+  
+hbase.rpc.protection
+authentication
+  
+
 



[1/2] ambari git commit: AMBARI-9471 Ambari Web UI changes required to support Ranger Installation part 2 (recommit). (ababiichuk)

2015-02-11 Thread ababiichuk
Repository: ambari
Updated Branches:
  refs/heads/trunk fb0903e50 -> 1d6379345


AMBARI-9471 Ambari Web UI changes required to support Ranger Installation part 
2 (recommit). (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 7656f2fb28dce98806664e2f2a5f527a8bd1
Parents: fb0903e
Author: aBabiichuk 
Authored: Wed Feb 11 17:53:26 2015 +0200
Committer: aBabiichuk 
Committed: Wed Feb 11 19:00:55 2015 +0200

--
 ambari-web/app/data/HDP2.2/site_properties.js | 308 ++---
 ambari-web/app/models/stack_service.js|   6 +-
 ambari-web/app/utils/config.js|   1 +
 ambari-web/app/views/common/controls_view.js  |   6 +-
 4 files changed, 220 insertions(+), 101 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7656f2fb/ambari-web/app/data/HDP2.2/site_properties.js
--
diff --git a/ambari-web/app/data/HDP2.2/site_properties.js 
b/ambari-web/app/data/HDP2.2/site_properties.js
index 8873a25..c4f792a 100644
--- a/ambari-web/app/data/HDP2.2/site_properties.js
+++ b/ambari-web/app/data/HDP2.2/site_properties.js
@@ -136,20 +136,30 @@ hdp22properties.push(
 "serviceName": "HDFS"
   },
   {
-"id": "puppet var",
-"name": "RANGER_HOST",
-"displayName": "Policy Admin URL",
-"value": "",
-"defaultValue": "",
-"description": "The host that has been assigned to run Ranger Server",
-"displayType": "masterHost",
-"isOverridable": false,
-"isVisible": true,
-"isRequiredByAgent": false,
-"isRequired": false,
-"serviceName": "HDFS",
+"id": "site property",
+"name": "POLICY_USER",
+"value": "ambari-qa",
+"defaultValue": "ambari-qa",
+"displayName": "policy User for HDFS",
 "filename": "ranger-hdfs-plugin-properties.xml",
-"category": "Advanced ranger-hdfs-plugin-properties"
+"category": "Advanced ranger-hdfs-plugin-properties",
+"serviceName": "HDFS"
+  },
+  {
+"id": "site property",
+"name": "REPOSITORY_CONFIG_PASSWORD",
+"displayName": "Ranger repository config password",
+"filename": "ranger-hdfs-plugin-properties.xml",
+"category": "Advanced ranger-hdfs-plugin-properties",
+"serviceName": "HDFS"
+  },
+  {
+"id": "site property",
+"name": "REPOSITORY_CONFIG_USERNAME",
+"displayName": "Ranger repository config user",
+"filename": "ranger-hdfs-plugin-properties.xml",
+"category": "Advanced ranger-hdfs-plugin-properties",
+"serviceName": "HDFS"
   },
   /*RANGER FOR HIVE/
   {
@@ -183,29 +193,39 @@ hdp22properties.push(
   },
   {
 "id": "site property",
-"name": "UPDATE_XAPOLICIES_ON_GRANT_REVOKE",
-"defaultValue": true,
-"displayName": "Should Hive GRANT/REVOKE update XA policies?",
-"displayType": "checkbox",
+"name": "POLICY_USER",
+"value": "ambari-qa",
+"defaultValue": "ambari-qa",
+"displayName": "policy User for HIVE",
 "filename": "ranger-hive-plugin-properties.xml",
 "category": "Advanced ranger-hive-plugin-properties",
 "serviceName": "HIVE"
   },
   {
-"id": "puppet var",
-"name": "RANGER_HOST",
-"displayName": "Policy Admin URL",
-"value": "",
-"defaultValue": "",
-"description": "The host that has been assigned to run Ranger Server",
-"displayType": "masterHost",
-"isOverridable": false,
-"isVisible": true,
-"isRequiredByAgent": false,
-"isRequired": false,
-"serviceName": "HIVE",
+"id": "site property",
+"name": "REPOSITORY_CONFIG_PASSWORD",
+"displayName": "Ranger repository config password",
 "filename": "ranger-hive-plugin-properties.xml",
-"category": "Advanced ranger-hive-plugin-properties"
+"category": "Advanced ranger-hive-plugin-properties",
+"serviceName": "HIVE"
+  },
+  {
+"id": "site property",
+"name": "REPOSITORY_CONFIG_USERNAME",
+"displayName": "Ranger repository config user",
+"filename": "ranger-hive-plugin-properties.xml",
+"category": "Advanced ranger-hive-plugin-properties",
+"serviceName": "HIVE"
+  },
+  {
+"id": "site property",
+"name": "UPDATE_XAPOLICIES_ON_GRANT_REVOKE",
+"defaultValue": true,
+"displayType": "checkbox",
+"displayName": "Should Hive GRANT/REVOKE update XA policies?",
+"filename": "ranger-hive-plugin-properties.xml",
+"category": "Advanced ranger-hive-plugin-properties",
+"serviceName": "HIVE"
   },
   /*RANGER FOR HBASE/
   {
@@ -239,6 +259,32 @@ hdp22properties.push(
   },
   {
 "id": "site property",
+"name":

[2/2] ambari git commit: AMBARI-9570 In Stack Advisor popup, "Proceed Anyway" button should be red. (ababiichuk)

2015-02-11 Thread ababiichuk
AMBARI-9570 In Stack Advisor popup, "Proceed Anyway" button should be red. 
(ababiichuk)


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

Branch: refs/heads/trunk
Commit: 1d6379345f6ff69ec0ac7b8ce051ae04b8afcef4
Parents: 7656f2f
Author: aBabiichuk 
Authored: Wed Feb 11 18:04:38 2015 +0200
Committer: aBabiichuk 
Committed: Wed Feb 11 19:00:56 2015 +0200

--
 ambari-web/app/mixins/common/serverValidator.js | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1d637934/ambari-web/app/mixins/common/serverValidator.js
--
diff --git a/ambari-web/app/mixins/common/serverValidator.js 
b/ambari-web/app/mixins/common/serverValidator.js
index 449b1ee..dd8a926 100644
--- a/ambari-web/app/mixins/common/serverValidator.js
+++ b/ambari-web/app/mixins/common/serverValidator.js
@@ -262,6 +262,7 @@ App.ServerValidatorMixin = Em.Mixin.create({
 header: Em. I18n.t('installer.step7.popup.validation.warning.header'),
 classNames: ['sixty-percent-width-modal'],
 primary: Em.I18n.t('common.proceedAnyway'),
+primaryClass: 'btn-danger',
 onPrimary: function () {
   this.hide();
   deferred.resolve();
@@ -270,6 +271,10 @@ App.ServerValidatorMixin = Em.Mixin.create({
   this.hide();
   deferred.reject("invalid_configs"); // message used to differentiate 
types of rejections.
 },
+onClose: function () {
+  this.hide();
+  deferred.reject("invalid_configs"); // message used to differentiate 
types of rejections.
+},
 bodyClass: Em.View.extend({
   controller: self,
   templateName: 
require('templates/common/configs/config_recommendation_popup')



ambari git commit: AMBARI-9571. Incorrect Add Service Wizard behaviour after page refresh on Step 1. (akovalenko)

2015-02-11 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 3959000c6 -> fb0903e50


AMBARI-9571. Incorrect Add Service Wizard behaviour after page refresh on Step 
1. (akovalenko)


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

Branch: refs/heads/trunk
Commit: fb0903e505cb4a5dbe5c84cff6d6a048d2efd03c
Parents: 3959000
Author: Aleksandr Kovalenko 
Authored: Wed Feb 11 18:10:20 2015 +0200
Committer: Aleksandr Kovalenko 
Committed: Wed Feb 11 18:12:07 2015 +0200

--
 ambari-web/app/templates/wizard/step4.hbs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fb0903e5/ambari-web/app/templates/wizard/step4.hbs
--
diff --git a/ambari-web/app/templates/wizard/step4.hbs 
b/ambari-web/app/templates/wizard/step4.hbs
index 71835d5..759e9b9 100644
--- a/ambari-web/app/templates/wizard/step4.hbs
+++ b/ambari-web/app/templates/wizard/step4.hbs
@@ -36,7 +36,7 @@
 {{#each controller}}
   {{#unless isHiddenOnSelectServicePage}}
 
-  {{view Ember.Checkbox 
elementIdBinding="serviceName"
+  {{view Ember.Checkbox 
classBinding="serviceName"
   disabledBinding="isInstalled"
   
checkedBinding="isSelected"}}{{displayNameOnSelectServicePage}}
   



ambari git commit: AMBARI-9567. Generation of HDFS/HIVE/HCAT/HBASE Client configurations file has failed with 500 error (aonishuk)

2015-02-11 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk dbafa08de -> 3959000c6


AMBARI-9567. Generation of HDFS/HIVE/HCAT/HBASE Client configurations file has 
failed with 500 error (aonishuk)


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

Branch: refs/heads/trunk
Commit: 3959000c69419f29e8ef76b4fe41f98025cf5c99
Parents: dbafa08
Author: Andrew Onishuk 
Authored: Wed Feb 11 18:08:49 2015 +0200
Committer: Andrew Onishuk 
Committed: Wed Feb 11 18:08:49 2015 +0200

--
 .../server/controller/internal/ClientConfigResourceProvider.java| 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3959000c/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
index 0fa1b7c..6b5d6d2 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
@@ -302,6 +302,7 @@ public class ClientConfigResourceProvider extends 
AbstractControllerResourceProv
   jsonContent.put("clusterHostInfo", clusterHostInfo);
   jsonContent.put("hostLevelParams", hostLevelParams);
   jsonContent.put("hostname", hostName);
+  jsonContent.put("clusterName", cluster.getClusterName());
   jsonConfigurations = gson.toJson(jsonContent);
 
   File jsonFileName = new File(TMP_PATH + File.separator + componentName + 
"-configuration.json");



ambari git commit: AMBARI-9569 Move NameNode wizard fails. (atkach)

2015-02-11 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk 7e667816a -> dbafa08de


AMBARI-9569 Move NameNode wizard fails. (atkach)


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

Branch: refs/heads/trunk
Commit: dbafa08de1105a8d012837fb7a0b41659f955182
Parents: 7e66781
Author: Andrii Tkach 
Authored: Wed Feb 11 17:33:05 2015 +0200
Committer: Andrii Tkach 
Committed: Wed Feb 11 18:03:06 2015 +0200

--
 .../main/service/reassign/step1_controller.js   | 20 +++-
 .../main/service/reassign/step4_controller.js   |  8 
 .../main/service/reassign/step6_controller.js   |  1 +
 3 files changed, 16 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/dbafa08d/ambari-web/app/controllers/main/service/reassign/step1_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step1_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step1_controller.js
index ff12a62..f364642 100644
--- a/ambari-web/app/controllers/main/service/reassign/step1_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step1_controller.js
@@ -73,15 +73,17 @@ App.ReassignMasterWizardStep1Controller = 
Em.Controller.extend({
   onLoadConfigsTags: function (data) {
 var urlParams = 
this.getConfigUrlParams(this.get('content.reassign.component_name'), data);
 
-App.ajax.send({
-  name: 'reassign.load_configs',
-  sender: this,
-  data: {
-urlParams: urlParams.join('|')
-  },
-  success: 'onLoadConfigs',
-  error: ''
-});
+if (urlParams.length > 0) {
+  App.ajax.send({
+name: 'reassign.load_configs',
+sender: this,
+data: {
+  urlParams: urlParams.join('|')
+},
+success: 'onLoadConfigs',
+error: ''
+  });
+}
   },
 
   onLoadConfigs: function (data) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/dbafa08d/ambari-web/app/controllers/main/service/reassign/step4_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step4_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
index dc70225..1060e49 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -287,12 +287,11 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
* remove tasks by command name
*/
   removeTasks: function(commands) {
-var tasks = this.get('tasks'),
-index = null
-cmd = null;
+var tasks = this.get('tasks');
 
 commands.forEach(function(command) {
-  cmd = tasks.filterProperty('command', command);
+  var cmd = tasks.filterProperty('command', command);
+  var index = null;
 
   if (cmd.length === 0) {
 return false;
@@ -334,6 +333,7 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
   }));
 }
 this.removeUnneededTasks();
+this.set('isLoaded', true);
   },
 
   hideRollbackButton: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/dbafa08d/ambari-web/app/controllers/main/service/reassign/step6_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step6_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
index bd9efb4..a038fbe 100644
--- a/ambari-web/app/controllers/main/service/reassign/step6_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
@@ -65,6 +65,7 @@ App.ReassignMasterWizardStep6Controller = 
App.HighAvailabilityProgressPageContro
 }
 
 this.removeUnneededTasks();
+this.set('isLoaded', true);
   },
 
   removeUnneededTasks: function () {



[2/2] ambari git commit: AMBARI-9565 Add service wizard: check (and fix if needed) handling KDC credentials error. (ababiichuk)

2015-02-11 Thread ababiichuk
AMBARI-9565 Add service wizard: check (and fix if needed) handling KDC 
credentials error. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 7e667816a55466ee5114bdb76277cdb9c442be7f
Parents: e1114f5
Author: aBabiichuk 
Authored: Wed Feb 11 16:18:21 2015 +0200
Committer: aBabiichuk 
Committed: Wed Feb 11 16:18:21 2015 +0200

--
 .../main/admin/kerberos/step2_controller.js |   4 +-
 .../controllers/main/service/add_controller.js  | 113 ---
 ambari-web/app/routes/add_service_routes.js |  11 +-
 ambari-web/app/utils/ajax/ajax.js   |  20 +++-
 .../common/modal_popups/invalid_KDC_popup.js|  12 ++
 .../main/service/add_controller_test.js |   1 +
 6 files changed, 130 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7e667816/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
index a641f4c..b8f598b 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
@@ -263,8 +263,8 @@ App.KerberosWizardStep2Controller = 
App.WizardStep7Controller.extend({
* puts kerberos admin credentials in the live cluster session
* @returns {*} jqXHr
*/
-  createKerberosAdminSession: function () {
-var configs = this.get('stepConfigs')[0].get('configs');
+  createKerberosAdminSession: function (configs) {
+configs = configs || this.get('stepConfigs')[0].get('configs');
 var adminPrincipalValue = configs.findProperty('name', 
'admin_principal').value;
 var adminPasswordValue = configs.findProperty('name', 
'admin_password').value;
 return App.ajax.send({

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e667816/ambari-web/app/controllers/main/service/add_controller.js
--
diff --git a/ambari-web/app/controllers/main/service/add_controller.js 
b/ambari-web/app/controllers/main/service/add_controller.js
index 7f86969..f493a4b 100644
--- a/ambari-web/app/controllers/main/service/add_controller.js
+++ b/ambari-web/app/controllers/main/service/add_controller.js
@@ -36,6 +36,11 @@ App.AddServiceController = App.WizardController.extend({
   serviceToInstall: null,
 
   /**
+   *
+   */
+  installClientQueueLength: 0,
+
+  /**
* All wizards data will be stored in this variable
*
* cluster - cluster name
@@ -128,6 +133,8 @@ App.AddServiceController = App.WizardController.extend({
   this.checkSecurityStatus();
   this.load('cluster');
   this.set('content.additionalClients', []);
+  this.set('installClientQueueLength', 0);
+  this.set('installClietsQueue', App.ajaxQueue.create({}));
 }
   }
 ]
@@ -500,13 +507,37 @@ App.AddServiceController = App.WizardController.extend({
   "urlParams": "ServiceInfo/service_name.in(" + selectedServices.join(',') 
 + ")"
 };
   },
-  installServices: function (callback) {
+
+  /**
+   * run this method after success/error callbacks
+   * for installServicesRequest
+   */
+  installServicesComplete: function () {
+this.setDBProperty('KDCAuthRequired', false);
+App.get('router.wizardStep8Controller').set('servicesInstalled', true);
+this.setInfoForStep9();
+this.saveClusterState('ADD_SERVICES_INSTALLING_3');
+App.router.transitionTo('step7');
+  },
+
+  /**
+   * main method for installinf clients
+   * @method installServices
+   */
+  installServices: function () {
+var self = this;
+this.setDBProperty('KDCAuthRequired', false);
 this.set('content.cluster.oldRequestsId', []);
-this.installAdditionalClients();
+this.installAdditionalClients().done(function () {
+  self.installSelectedServices();
+});
+  },
+
+  installSelectedServices: function () {
 var name = 'common.services.update';
 var selectedServices = 
this.get('content.services').filterProperty('isInstalled', 
false).filterProperty('isSelected', true).mapProperty('serviceName');
 var data = this.generateDataForInstallServices(selectedServices);
-this.installServicesRequest(name, data, callback);
+this.installServicesRequest(name, data, 
this.installServicesComplete.bind(this));
   },
 
   installServicesRequest: function (name, data, callback) {
@@ -526,22 +557,68 @@ App.AddServiceController = App.WizardController.ex

[1/2] ambari git commit: AMBARI-9562 Kerberos Wizard: Configs are not displayed for Advanced tab on Configure Identities step. (ababiichuk)

2015-02-11 Thread ababiichuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 0f22258c8 -> 7e667816a


AMBARI-9562 Kerberos Wizard: Configs are not displayed for Advanced tab on 
Configure Identities step. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: e1114f57cf6e01cebb45a0f5fd71bd2d63992ff4
Parents: 0f22258
Author: aBabiichuk 
Authored: Wed Feb 11 14:02:43 2015 +0200
Committer: aBabiichuk 
Committed: Wed Feb 11 16:16:42 2015 +0200

--
 .../main/admin/kerberos/step4_controller.js| 13 +
 .../main/admin/kerberos/step4_controller_test.js   |  7 +++
 2 files changed, 16 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e1114f57/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
index f03b054..3043ddd 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
@@ -83,12 +83,17 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
* @returns {[App.ServiceConfigCategory]}
*/
   createCategoryForServices: function() {
-var services = App.StackService.find().filter(function(s) {
-  return s.get('isInstalled') || (s.get('isSelected') && 
this.get('wizardController.name') == 'addServiceController');
-}, this);
+var services = [];
+if (this.get('wizardController.name') == 'addServiceController') {
+  services = App.StackService.find().filter(function(item) {
+return item.get('isInstalled') || item.get('isSelected');
+  });
+} else {
+  services = App.Service.find();
+}
 return services.map(function(item) {
   return App.ServiceConfigCategory.create({ name: item.get('serviceName'), 
displayName: item.get('displayName'), collapsedByDefault: true});
-})
+});
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/e1114f57/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
--
diff --git 
a/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js 
b/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
index b67b3dd..c86f314 100644
--- a/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
@@ -219,6 +219,12 @@ describe('App.KerberosWizardStep4Controller', function() {
   }
 });
 beforeEach(function() {
+  sinon.stub(App.Service, 'find').returns([
+Em.Object.create({
+  serviceName: 'HDFS',
+  displayName: 'HDFS'
+})
+  ]);
   sinon.stub(App.StackService, 'find').returns([
 Em.Object.create({
   serviceName: 'HDFS',
@@ -235,6 +241,7 @@ describe('App.KerberosWizardStep4Controller', function() {
 });
 
 afterEach(function() {
+  App.Service.find.restore();
   App.StackService.find.restore();
 });
 



ambari git commit: AMBARI-9563 Versions: use version name (display_name), not technical version, in the UI. (atkach)

2015-02-11 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk e52dbb5f4 -> 0f22258c8


AMBARI-9563 Versions: use version name (display_name), not technical version, 
in the UI. (atkach)


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

Branch: refs/heads/trunk
Commit: 0f22258c801d409527cc3b5a894c377525a8bbbd
Parents: e52dbb5
Author: Andrii Tkach 
Authored: Wed Feb 11 14:04:17 2015 +0200
Committer: Andrii Tkach 
Committed: Wed Feb 11 15:32:41 2015 +0200

--
 .../stackVersions/StackVersionsEditCtrl.js|  5 +++--
 .../ui/admin-web/app/scripts/services/Stack.js|  2 ++
 .../main/resources/ui/admin-web/app/styles/main.css   |  4 
 .../app/views/modals/BodyForDeregisterVersion.html|  2 +-
 .../ui/admin-web/app/views/stackVersions/list.html|  2 +-
 .../app/views/stackVersions/stackVersionPage.html |  4 ++--
 ambari-web/app/controllers/main/host.js   | 10 +-
 ambari-web/app/messages.js|  1 +
 .../main/admin/stack_upgrade/upgrade_version_box.hbs  |  6 +++---
 ambari-web/app/templates/main/host/stack_versions.hbs |  2 +-
 .../admin/stack_upgrade/upgrade_version_box_view.js   | 14 +++---
 ambari-web/app/views/main/host.js | 12 ++--
 ambari-web/app/views/main/host/stack_versions_view.js | 10 +-
 13 files changed, 41 insertions(+), 33 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
index 0d0a363..dcd79df 100644
--- 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
+++ 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
@@ -30,6 +30,7 @@ angular.module('ambariAdminConsole')
   $scope.stack = response.stack;
   $scope.stackName = response.stackName;
   $scope.versionName = response.versionName;
+  $scope.displayName = response.displayName;
   $scope.stackVersion = response.stackVersion;
   $scope.updateObj = response.updateObj;
   $scope.subversion = response.versionName.substring(4); // cut off stack 
version
@@ -144,7 +145,7 @@ angular.module('ambariAdminConsole')
 return Stack.validateBaseUrls($scope.skipValidation, $scope.osList, 
upgradeStack).then(function (invalidUrls) {
   if (invalidUrls.length === 0) {
 Stack.updateRepo($scope.stackName, $scope.stackVersion, $scope.id, 
$scope.updateObj).then(function () {
-  Alert.success('Edited version ' + 
$scope.repoVersionFullName + '');
+  Alert.success('Edited version ' + $scope.displayName + 
'');
   $location.path('/stackVersions');
 }).catch(function (data) {
   Alert.error('Version update error', data.message);
@@ -174,7 +175,7 @@ angular.module('ambariAdminConsole')
 
   $scope.delete = function () {
 ConfirmationModal.show('Deregister Version', { "url": 
'views/modals/BodyForDeregisterVersion.html',
-  "scope": {"repoVersionFullName": $scope.repoVersionFullName 
}}).then(function() {
+  "scope": {"displayName": $scope.displayName }}).then(function() {
   Stack.deleteRepo($scope.stackName, $scope.stackVersion, $scope.id).then( 
function () {
 $location.path('/stackVersions');
   }).catch(function (data) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f22258c/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
--
diff --git 
a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js 
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
index 681b844..d37c714 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/services/Stack.js
@@ -147,6 +147,7 @@ angular.module('ambariAdminConsole')
 getRepo: function (repoVersion, stack_name) {
   var url = Settings.baseUrl + '/stacks/' + stack_name + '/versions?' +
   'fields=repository_versions/operating_systems/repositories/*' +
+  ',repository_versions/RepositoryVersions/display_name' +
   '&repository_versions/RepositoryVersions/repository_version='

ambari git commit: AMBARI-9553. Ranger:Add Service wizard navigates to 'Configure Identities' step for unsecure cluster. (akovalenko)

2015-02-11 Thread akovalenko
Repository: ambari
Updated Branches:
  refs/heads/trunk edec73af9 -> e52dbb5f4


AMBARI-9553. Ranger:Add Service wizard navigates to 'Configure Identities' step 
for unsecure cluster. (akovalenko)


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

Branch: refs/heads/trunk
Commit: e52dbb5f471b2e4d315a38c145cbf00e5694b9a1
Parents: edec73a
Author: Aleksandr Kovalenko 
Authored: Tue Feb 10 20:08:40 2015 +0200
Committer: Aleksandr Kovalenko 
Committed: Wed Feb 11 15:13:53 2015 +0200

--
 .../main/admin/kerberos/step4_controller.js |  4 ++
 .../controllers/main/service/add_controller.js  |  1 +
 .../admin/kerberos/step4_controller_test.js | 51 +++-
 3 files changed, 55 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e52dbb5f/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
--
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
index d8cd8a6..f03b054 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step4_controller.js
@@ -31,6 +31,10 @@ App.KerberosWizardStep4Controller = 
App.WizardStep7Controller.extend(App.AddSecu
   },
   
   loadStep: function() {
+if (this.get('wizardController.skipConfigureIdentitiesStep')) {
+  App.router.send('next');
+  return;
+}
 var self = this;
 this.clearStep();
 this.getDescriptorConfigs().then(function(properties) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e52dbb5f/ambari-web/app/controllers/main/service/add_controller.js
--
diff --git a/ambari-web/app/controllers/main/service/add_controller.js 
b/ambari-web/app/controllers/main/service/add_controller.js
index 0043f92..7f86969 100644
--- a/ambari-web/app/controllers/main/service/add_controller.js
+++ b/ambari-web/app/controllers/main/service/add_controller.js
@@ -547,6 +547,7 @@ App.AddServiceController = App.WizardController.extend({
   checkSecurityStatus: function() {
 if (App.supports.automatedKerberos) {
   if (!App.router.get('mainAdminKerberosController.securityEnabled')) {
+this.set('skipConfigureIdentitiesStep', true);
 this.get('isStepDisabled').findProperty('step', 5).set('value', true);
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e52dbb5f/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
--
diff --git 
a/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js 
b/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
index 4316bf5..b67b3dd 100644
--- a/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/kerberos/step4_controller_test.js
@@ -247,6 +247,55 @@ describe('App.KerberosWizardStep4Controller', function() {
   controller.set('wizardController.name', 'KerberosWizard');
   
expect(controller.createCategoryForServices()).to.eql([App.ServiceConfigCategory.create({
 name: 'HDFS', displayName: 'HDFS', collapsedByDefault: true})]);
 });
-  })
+  });
+
+  describe('#loadStep', function() {
+
+describe('skip "Configure Identities" step', function() {
+  beforeEach(function() {
+this.controller = App.KerberosWizardStep4Controller.create({});
+this.wizardController = App.AddServiceController.create({});
+this.controller.set('wizardController', this.wizardController);
+sinon.stub(this.controller, 'clearStep').returns(true);
+sinon.stub(this.controller, 'getDescriptorConfigs').returns((new 
$.Deferred()).resolve(true).promise());
+sinon.stub(this.controller, 'setStepConfigs').returns(true);
+sinon.stub(App.router, 'send').withArgs('next');
+  });
+
+  afterEach(function() {
+this.controller.clearStep.restore();
+this.controller.getDescriptorConfigs.restore();
+this.controller.setStepConfigs.restore();
+App.router.send.restore();
+  });
+
+  var tests = [
+{
+  securityEnabled: true,
+  stepSkipped: false,
+},
+{
+  securityEnabled: false,
+  stepSkipped: true
+}
+  ];
+
+  tests.forEach(function(test) {
+it('security {0} configure identities step should be 
{1}'.format(!!test.securityEnabled ? 'enabled' : 'disabled', 

ambari git commit: AMBARI-9564. Add warning if the user tries to install Spark with "HDP 2.2" (warn that it won't work with HDP 2.2.0). (onechiporenko)

2015-02-11 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 524732bee -> edec73af9


AMBARI-9564. Add warning if the user tries to install Spark with "HDP 2.2" 
(warn that it won't work with HDP 2.2.0). (onechiporenko)


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

Branch: refs/heads/trunk
Commit: edec73af9b30d720734c99c8504fa2997cd88366
Parents: 524732b
Author: Oleg Nechiporenko 
Authored: Wed Feb 11 14:14:17 2015 +0200
Committer: Oleg Nechiporenko 
Committed: Wed Feb 11 14:14:17 2015 +0200

--
 .../app/controllers/wizard/step4_controller.js  |  35 
 ambari-web/app/messages.js  |   1 +
 .../test/controllers/wizard/step4_test.js   | 175 ++-
 3 files changed, 207 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/edec73af/ambari-web/app/controllers/wizard/step4_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step4_controller.js 
b/ambari-web/app/controllers/wizard/step4_controller.js
index c4b19a3..54b755f 100644
--- a/ambari-web/app/controllers/wizard/step4_controller.js
+++ b/ambari-web/app/controllers/wizard/step4_controller.js
@@ -108,6 +108,22 @@ App.WizardStep4Controller = Em.ArrayController.extend({
   },
 
   /**
+   * Warn user if he tries to install Spark with HDP 2.2
+   * @method sparkValidation
+   */
+  sparkValidation: function () {
+var sparkService = this.findProperty('serviceName', 'SPARK');
+if (sparkService && sparkService.get('isSelected') && 
!sparkService.get('isInstalled') &&
+  App.get('currentStackName') == 'HDP' && 
App.get('currentStackVersionNumber') == '2.2') {
+  this.addValidationError({
+id: 'sparkWarning',
+type: 'WARNING',
+callback: this.sparkWarningPopup
+  });
+}
+  },
+
+  /**
* Onclick handler for Next button.
* @method submit
*/
@@ -145,6 +161,7 @@ App.WizardStep4Controller = Em.ArrayController.extend({
   this.ambariMetricsValidation();
 }
 this.rangerValidation();
+this.sparkValidation();
 if (!!this.get('errorStack').filterProperty('isShown', false).length) {
   this.showError(this.get('errorStack').findProperty('isShown', false));
   return false;
@@ -398,5 +415,23 @@ App.WizardStep4Controller = Em.ArrayController.extend({
 this.hide();
   }
 });
+  },
+
+  /**
+   * Show popup with Spark installation warning
+   * @return {App.ModalPopup}
+   * @method sparkWarningPopup
+   */
+  sparkWarningPopup: function () {
+var self = this;
+return App.ModalPopup.show({
+  header: Em.I18n.t('common.warning'),
+  body: Em.I18n.t('installer.step4.sparkWarning.popup.body'),
+  primary: Em.I18n.t('common.proceedAnyway'),
+  onPrimary: function () {
+self.onPrimaryPopupCallback();
+this.hide();
+  }
+});
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/edec73af/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 369a2c5..4da3334 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -662,6 +662,7 @@ Em.I18n.translations = {
 'Execute the following command on the Ambari Server host. Replace 
database-type with mysql or 
oracle and /jdbc/driver/path based on the 
location of the MySQL or Oracle JDBC driver:' +
 'ambari-server setup --jdbc-db={database-type} 
--jdbc-driver={/jdbc/driver/path}',
   'installer.step4.rangerRequirements.popup.body.confirmation': 'I have met 
all the requirements above.',
+  'installer.step4.sparkWarning.popup.body': 'Spark requires HDP 2.2.1 or 
later. Attempting to install Spark to a HDP 2.2.0 cluster will fail. Confirm 
you are using HDP 2.2.1 or later packages. Are you sure you want to proceed?',
 
   'installer.step5.header':'Assign Masters',
   'installer.step5.reassign.header':'Select Target Host',

http://git-wip-us.apache.org/repos/asf/ambari/blob/edec73af/ambari-web/test/controllers/wizard/step4_test.js
--
diff --git a/ambari-web/test/controllers/wizard/step4_test.js 
b/ambari-web/test/controllers/wizard/step4_test.js
index 00965c8..6e803ce 100644
--- a/ambari-web/test/controllers/wizard/step4_test.js
+++ b/ambari-web/test/controllers/wizard/step4_test.js
@@ -25,7 +25,7 @@ describe('App.WizardStep4Controller', function () {
 
   var services = [
 'HDFS', 'GANGLIA', 'OOZIE', 'HIVE', 'HBASE', 'PIG', 'SCOOP', 'ZOOKEEPER',
-'YARN', 'MAPREDUCE2', 'FALCON', 'TEZ