[2/3] ambari git commit: AMBARI-13725: HAWQ and PXF to support 3 digit versioning instead of 4.(jaoki)

2015-11-09 Thread jaoki
http://git-wip-us.apache.org/repos/asf/ambari/blob/d02ec979/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
new file mode 100644
index 000..41b10dc
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-site.xml
@@ -0,0 +1,178 @@
+
+
+
+  
+hawq_master_address_host
+HAWQ Master
+localhost
+The host name of HAWQ master.
+  
+
+  
+hawq_standby_address_host
+HAWQ Standby Master
+localhost
+The host name of HAWQ standby.
+  
+
+  
+hawq_master_address_port
+HAWQ Master Port
+5432
+The port of HAWQ master.
+  
+
+  
+hawq_segment_address_port
+HAWQ Segment Port
+4
+The port of HAWQ segment.
+  
+
+  
+hawq_dfs_url
+HAWQ DFS URL
+localhost:8020/hawq_default
+URL for accessing HDFS.
+  
+
+  
+hawq_master_directory
+HAWQ Master Directory
+/data/hawq/master
+The directory of HAWQ master.
+  
+
+  
+hawq_segment_directory
+HAWQ Segment Directory
+/data/hawq/segment
+The directory of HAWQ segment.
+   
+
+  
+hawq_master_temp_directory
+HAWQ Master Temp Directory
+/tmp
+The temporary directory reserved for HAWQ 
master.
+  
+
+  
+hawq_segment_temp_directory
+HAWQ Segment Temp Directory
+/tmp
+The temporary directory reserved for HAWQ 
segment.
+  
+
+  
+  
+hawq_global_rm_type
+none
+The resource manager type to start for allocating resource. 
+  'none' means HAWQ resource manager exclusively uses whole
+  cluster; 'yarn' means HAWQ resource manager contacts YARN
+  resource manager to negotiate resource.
+
+  
+
+  
+hawq_rm_memory_limit_perseg
+64GB
+The limit of memory usage in a HAWQ segment when 
+  hawq_global_rm_type is set 'none'.
+
+  
+
+  
+hawq_rm_nvcore_limit_perseg
+16
+The limit of virtual core usage in a HAWQ segment when 
+  hawq_global_rm_type is set 'none'.
+
+  
+
+  
+hawq_rm_yarn_address
+localhost:8032
+The address of YARN resource manager server.
+  
+
+  
+hawq_rm_yarn_scheduler_address
+localhost:8030
+The address of YARN scheduler server.
+  
+
+  
+hawq_rm_yarn_queue_name
+default
+The YARN queue name to register HAWQ resource 
manager.
+  
+
+  
+hawq_rm_yarn_app_name
+hawq
+The application name to register HAWQ resource manager in 
YARN.
+  
+
+  
+hawq_re_cpu_enable
+false
+  
+
+  
+hawq_re_cgroup_mount_point
+/sys/fs/cgroup
+  
+
+  
+hawq_re_cgroup_hierarchy_name
+hadoop-yarn
+  
+
+  
+hawq_re_cleanup_period
+180
+  
+
+  
+hawq_re_cpu_weight
+1024.0
+  
+
+  
+hawq_re_vcore_pcore_ratio
+1.0
+  
+
+  
+hawq_resourcemanager_master_address_domainsocket_port
+5436
+  
+
+  
+hawq_rm_master_port
+5437
+  
+
+  
+hawq_rm_segment_port
+5438
+  
+
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/d02ec979/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-sysctl-env.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-sysctl-env.xml
 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-sysctl-env.xml
new file mode 100644
index 000..32ae5a5
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0/configuration/hawq-sysctl-env.xml
@@ -0,0 +1,247 @@
+
+
+
+  
+kernel.shmmax
+5
+Maximum size in bytes of a single shared memory segment that 
a Linux process can allocate in its
+  virtual address space
+
+  false
+  true
+
+  
+
+  
+kernel.shmmni
+4096
+System wide maximum number of shared memory 
segments
+
+  false
+  true
+
+  
+
+  
+kernel.shmall
+40
+Total amount of shared memory pages that can be used system 
wide
+
+  false
+  true
+
+  
+
+  
+kernel.sem
+250 512000 100 2048
+Parameter to define semaphore related values
+
+  false
+  true
+
+  
+
+  
+kernel.sysrq
+1
+Enable(1)/Disable(0) functions of sysrq
+
+  false
+  true
+
+  
+
+  
+kernel.core_uses_pid
+1
+Enable appending process id to the name of core dump file. 
Ex: core.PID
+
+  false
+  true
+
+  
+
+  
+kernel.msgmnb
+65536
+Default maximum size of a message in bytes
+
+  false
+  true
+
+  
+
+  
+kernel.msgmax
+65536
+Default maxmimum size of a mesage queue
+
+  false
+  true
+
+  
+
+  
+kernel.ms

[1/3] ambari git commit: AMBARI-13725: HAWQ and PXF to support 3 digit versioning instead of 4.(jaoki)

2015-11-09 Thread jaoki
Repository: ambari
Updated Branches:
  refs/heads/trunk 86820bc92 -> d02ec979f


http://git-wip-us.apache.org/repos/asf/ambari/blob/d02ec979/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py
new file mode 100644
index 000..a4986c9
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/params.py
@@ -0,0 +1,42 @@
+"""
+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.
+"""
+
+from resource_management import Script
+
+config = Script.get_config()
+
+
+pxf_service_name = "pxf-service"
+stack_name = str(config["hostLevelParams"]["stack_name"])
+
+# Users and Groups
+pxf_user = "pxf"
+pxf_group = pxf_user
+hdfs_superuser_group = 
config["configurations"]["hdfs-site"]["dfs.permissions.superusergroup"]
+user_group = config["configurations"]["cluster-env"]["user_group"]
+tomcat_group = "tomcat"
+
+# Directories
+pxf_conf_dir = "/etc/pxf/conf"
+pxf_instance_dir = "/var/pxf"
+
+# Java home path
+java_home = config["hostLevelParams"]["java_home"] if "java_home" in 
config["hostLevelParams"] else None
+
+# Timeouts
+default_exec_timeout = 600

http://git-wip-us.apache.org/repos/asf/ambari/blob/d02ec979/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/pxf.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/pxf.py
 
b/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/pxf.py
new file mode 100644
index 000..dd0031c
--- /dev/null
+++ 
b/ambari-server/src/main/resources/common-services/PXF/3.0.0/package/scripts/pxf.py
@@ -0,0 +1,120 @@
+#!/usr/bin/env python
+
+"""
+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.
+"""
+
+from resource_management import Script
+
+from resource_management.libraries.resources.xml_config import XmlConfig
+from resource_management.core.resources.accounts import User
+from resource_management.core.resources.system import Directory, File, Execute
+from resource_management.core.source import Template
+
+
+
+class Pxf(Script):
+  """
+  Contains the interface definitions for methods like install,
+  start, stop, status, etc. for the PXF
+  """
+
+  def install(self, env):
+self.install_packages(env)
+self.configure(env)
+
+
+  def configure(self, env):
+import params
+env.set_params(params)
+self.__setup_user_group()
+self.__generate_config_files()
+# pxf-service init exits safely when it is already initialized
+self.__execute_service_command("init")
+
+
+  def start(self, env):
+self.configure(env)
+self.__grant_permissions()
+self.__execute_service_command("restart")
+
+
+  def stop(self, env):
+self.__execute_service_command("stop")
+
+
+  def status(self, env):
+try:
+  self.__execute_service_command("status")
+except Exception:
+  raise ComponentIsNotRunning()
+
+
+  def __execute_service_command(self, command):
+import params
+Execute("service {0} {1}".format(params.pxf_service_name, command),
+  timeout=params.default_exec_timeout,
+  logoutput=True)
+
+
+  def __setup_user_group(self):
+"""
+Creates PXF user with the required groups and bash as default shell
+"""
+import pa

[3/3] ambari git commit: AMBARI-13725: HAWQ and PXF to support 3 digit versioning instead of 4.(jaoki)

2015-11-09 Thread jaoki
AMBARI-13725: HAWQ and PXF to support 3 digit versioning instead of 4.(jaoki)


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

Branch: refs/heads/trunk
Commit: d02ec979f223e91efaa5ad9db1ad6e6377f86dd5
Parents: 86820bc
Author: jaoki 
Authored: Mon Nov 9 22:40:14 2015 -0800
Committer: jaoki 
Committed: Mon Nov 9 22:40:14 2015 -0800

--
 ambari-server/pom.xml   |   3 -
 .../HAWQ/2.0.0.0/configuration/gpcheck-env.xml  |  86 --
 .../2.0.0.0/configuration/hawq-limits-env.xml   |  46 ---
 .../HAWQ/2.0.0.0/configuration/hawq-site.xml| 178 
 .../2.0.0.0/configuration/hawq-sysctl-env.xml   | 247 
 .../common-services/HAWQ/2.0.0.0/metainfo.xml   | 129 -
 .../HAWQ/2.0.0.0/package/scripts/common.py  | 283 ---
 .../HAWQ/2.0.0.0/package/scripts/constants.py   |  61 
 .../HAWQ/2.0.0.0/package/scripts/hawqmaster.py  |  55 
 .../HAWQ/2.0.0.0/package/scripts/hawqsegment.py | 102 ---
 .../HAWQ/2.0.0.0/package/scripts/hawqstandby.py |  58 
 .../HAWQ/2.0.0.0/package/scripts/hawqstatus.py  |  64 -
 .../2.0.0.0/package/scripts/master_helper.py| 194 -
 .../HAWQ/2.0.0.0/package/scripts/params.py  |  92 --
 .../2.0.0.0/package/scripts/service_check.py| 102 ---
 .../HAWQ/2.0.0.0/package/scripts/utils.py   | 108 ---
 .../2.0.0.0/package/templates/hawq-hosts.j2 |   5 -
 .../package/templates/hawq-profile.sh.j2|   8 -
 .../HAWQ/2.0.0.0/package/templates/slaves.j2|   3 -
 .../HAWQ/2.0.0/configuration/gpcheck-env.xml|  86 ++
 .../2.0.0/configuration/hawq-limits-env.xml |  46 +++
 .../HAWQ/2.0.0/configuration/hawq-site.xml  | 178 
 .../2.0.0/configuration/hawq-sysctl-env.xml | 247 
 .../common-services/HAWQ/2.0.0/metainfo.xml | 129 +
 .../HAWQ/2.0.0/package/scripts/common.py| 283 +++
 .../HAWQ/2.0.0/package/scripts/constants.py |  61 
 .../HAWQ/2.0.0/package/scripts/hawqmaster.py|  55 
 .../HAWQ/2.0.0/package/scripts/hawqsegment.py   | 102 +++
 .../HAWQ/2.0.0/package/scripts/hawqstandby.py   |  58 
 .../HAWQ/2.0.0/package/scripts/hawqstatus.py|  64 +
 .../HAWQ/2.0.0/package/scripts/master_helper.py | 194 +
 .../HAWQ/2.0.0/package/scripts/params.py|  92 ++
 .../HAWQ/2.0.0/package/scripts/service_check.py | 102 +++
 .../HAWQ/2.0.0/package/scripts/utils.py | 108 +++
 .../HAWQ/2.0.0/package/templates/hawq-hosts.j2  |  24 ++
 .../2.0.0/package/templates/hawq-profile.sh.j2  |  27 ++
 .../HAWQ/2.0.0/package/templates/slaves.j2  |  22 ++
 .../PXF/3.0.0.0/configuration/pxf-site.xml  |  19 --
 .../common-services/PXF/3.0.0.0/metainfo.xml|  71 -
 .../PXF/3.0.0.0/package/scripts/params.py   |  42 ---
 .../PXF/3.0.0.0/package/scripts/pxf.py  | 120 
 .../PXF/3.0.0.0/package/templates/pxf-env.j2|  34 ---
 .../PXF/3.0.0/configuration/pxf-site.xml|  19 ++
 .../common-services/PXF/3.0.0/metainfo.xml  |  71 +
 .../PXF/3.0.0/package/scripts/params.py |  42 +++
 .../PXF/3.0.0/package/scripts/pxf.py| 120 
 .../PXF/3.0.0/package/templates/pxf-env.j2  |  34 +++
 47 files changed, 2164 insertions(+), 2110 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d02ec979/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 5a7ddc4..17e9ea9 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -203,9 +203,6 @@
 
src/main/resources/stacks/HDP/2.0._/services/HBASE/package/templates/regionservers.j2
 
src/main/resources/stacks/HDPWIN/2.1/services/*/configuration*/*
 
-
-
src/main/resources/common-services/HAWQ/2.0.0.0/package/templates/*.j2
-
 
 src/test/resources/TestAmbaryServer.samples/**
 src/test/resources/*.txt

http://git-wip-us.apache.org/repos/asf/ambari/blob/d02ec979/ambari-server/src/main/resources/common-services/HAWQ/2.0.0.0/configuration/gpcheck-env.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0.0/configuration/gpcheck-env.xml
 
b/ambari-server/src/main/resources/common-services/HAWQ/2.0.0.0/configuration/gpcheck-env.xml
deleted file mode 100755
index a61a34f..000
--- 
a/ambari-server/src/main/resources/common-services/HAWQ/2.0.0.0/configuration/gpcheck-env.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-

ambari git commit: AMBARI-13781. Tez Ambari View: RM requests are proxied to http://rm-address:8088/proxy (DIPAYAN BHOWMICK via srimanth)

2015-11-09 Thread srimanth
Repository: ambari
Updated Branches:
  refs/heads/trunk ec6da401e -> 86820bc92


AMBARI-13781. Tez Ambari View: RM requests are proxied to 
http://rm-address:8088/proxy (DIPAYAN BHOWMICK via srimanth)


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

Branch: refs/heads/trunk
Commit: 86820bc921961fb20a2bd97702a6dbb6389d241d
Parents: ec6da40
Author: Srimanth Gunturi 
Authored: Mon Nov 9 21:49:01 2015 -0800
Committer: Srimanth Gunturi 
Committed: Mon Nov 9 21:51:13 2015 -0800

--
 .../main/java/org/apache/ambari/view/tez/rest/RMProxyResource.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/86820bc9/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/rest/RMProxyResource.java
--
diff --git 
a/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/rest/RMProxyResource.java
 
b/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/rest/RMProxyResource.java
index 95a8705..d3901c9 100644
--- 
a/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/rest/RMProxyResource.java
+++ 
b/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/rest/RMProxyResource.java
@@ -42,6 +42,6 @@ public class RMProxyResource extends BaseProxyResource {
   @Override
   public String getProxyUrl(String endpoint, MultivaluedMap 
queryParams) {
 String activeRMUrl = viewController.getActiveRMUrl();
-return String.format("%s/proxy/%s%s", activeRMUrl, endpoint, 
proxyHelper.getQueryParamsString(queryParams));
+return String.format("%s/%s%s", activeRMUrl, endpoint, 
proxyHelper.getQueryParamsString(queryParams));
   }
 }



ambari git commit: AMBARI-13781. Tez Ambari View: RM requests are proxied to http://rm-address:8088/proxy (DIPAYAN BHOWMICK via srimanth)

2015-11-09 Thread srimanth
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 e6b276c84 -> 5a4ba5e02


AMBARI-13781. Tez Ambari View: RM requests are proxied to 
http://rm-address:8088/proxy (DIPAYAN BHOWMICK via srimanth)


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

Branch: refs/heads/branch-2.1
Commit: 5a4ba5e02dc8920e15c7040d798376439b855b17
Parents: e6b276c
Author: Srimanth Gunturi 
Authored: Mon Nov 9 21:49:01 2015 -0800
Committer: Srimanth Gunturi 
Committed: Mon Nov 9 21:49:01 2015 -0800

--
 .../main/java/org/apache/ambari/view/tez/rest/RMProxyResource.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5a4ba5e0/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/rest/RMProxyResource.java
--
diff --git 
a/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/rest/RMProxyResource.java
 
b/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/rest/RMProxyResource.java
index 95a8705..d3901c9 100644
--- 
a/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/rest/RMProxyResource.java
+++ 
b/contrib/views/tez/src/main/java/org/apache/ambari/view/tez/rest/RMProxyResource.java
@@ -42,6 +42,6 @@ public class RMProxyResource extends BaseProxyResource {
   @Override
   public String getProxyUrl(String endpoint, MultivaluedMap 
queryParams) {
 String activeRMUrl = viewController.getActiveRMUrl();
-return String.format("%s/proxy/%s%s", activeRMUrl, endpoint, 
proxyHelper.getQueryParamsString(queryParams));
+return String.format("%s/%s%s", activeRMUrl, endpoint, 
proxyHelper.getQueryParamsString(queryParams));
   }
 }



ambari git commit: AMBARI-13783. Tez Ambari View : Make UI use proxy end points provided by AMBARI-13612 (Sreenath Somarajapuram via srimanth)

2015-11-09 Thread srimanth
Repository: ambari
Updated Branches:
  refs/heads/trunk 47e8d3ad9 -> ec6da401e


AMBARI-13783. Tez Ambari View : Make UI use proxy end points provided by 
AMBARI-13612 (Sreenath Somarajapuram via srimanth)


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

Branch: refs/heads/trunk
Commit: ec6da401e28f5146ab2d71c7e0a078254c0282b3
Parents: 47e8d3a
Author: Srimanth Gunturi 
Authored: Mon Nov 9 21:44:46 2015 -0800
Committer: Srimanth Gunturi 
Committed: Mon Nov 9 21:45:39 2015 -0800

--
 .../resources/ui/scripts/init-ambari-view.js| 146 +--
 1 file changed, 33 insertions(+), 113 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ec6da401/contrib/views/tez/src/main/resources/ui/scripts/init-ambari-view.js
--
diff --git 
a/contrib/views/tez/src/main/resources/ui/scripts/init-ambari-view.js 
b/contrib/views/tez/src/main/resources/ui/scripts/init-ambari-view.js
index 5c616e5..5152fb9 100644
--- a/contrib/views/tez/src/main/resources/ui/scripts/init-ambari-view.js
+++ b/contrib/views/tez/src/main/resources/ui/scripts/init-ambari-view.js
@@ -102,92 +102,6 @@ function redirectionCheck() {
   }
 }
 
-App.Helpers.ambari = (function () {
-  /**
-   * Stores parameters from Ambari.
-   */
-  var ambariParameters = {},
-
-  /**
-   * Constructs URL for fetching Ambari view instance parameters.
-   * @return {String}
-   */
-  getURL = function () {
-var urlParts = location.pathname.split('/');
-
-return "/api/v1/views/%@/versions/%@/instances/%@/resources/status".fmt(
-  urlParts[2],
-  urlParts[3],
-  urlParts[4]
-);
-  };
-
-  return {
-/**
- * Key for the property representing ATS url.
- */
-TIMELINE_URL: 'yarn.timeline-server.url',
-RM_URL: 'yarn.resourcemanager.url',
-
-/**
- * Returns parameter value.
- * @param {String} name
- * @return {String}
- * @method getParam
- */
-getParam: function (name) {
-  Ember.assert('Parameter not found!', ambariParameters[name]);
-  return ambariParameters[name];
-},
-
-/**
- * Get view instance properties provided by user.
- * @returns {$.ajax}
- * @method getInstanceParameters
- */
-getInstanceParameters: function () {
-  var hashArray = location.pathname.split('/'),
-  params = {
-view: hashArray[2],
-version: hashArray[3],
-instanceName: hashArray[4],
-clusterName: App.get('clusterName')
-  };
-
-  return $.ajax({
-type: 'GET',
-dataType: 'json',
-async: true,
-context: this,
-url: getURL(),
-success: this.getInstanceParametersSuccessCallback,
-error: this.getInstanceParametersErrorCallback
-  });
-},
-
-/**
- * Success callback for getInstanceParameters-request.
- * @param {object} data
- * @method getInstanceParametersSuccessCallback
- */
-getInstanceParametersSuccessCallback: function (data) {
-  Ember.assert('Ambari instance parameter weren`t returned by the 
service!', data.parameters);
-  ambariParameters = data.parameters;
-},
-
-/**
- * Error callback for getInstanceParameters-request.
- * @method getInstanceParametersErrorCallback
- */
-getInstanceParametersErrorCallback: function (request, ajaxOptions, error) 
{
-  var json = request.responseJSON;
-  App.Helpers.ErrorBar.getInstance().show(json.message, json.trace);
-  Ember.assert(json.message);
-}
-  };
-
-})();
-
 function allowFullScreen() {
   if(window.parent) {
 var arrFrames = parent.document.getElementsByTagName("IFRAME"),
@@ -205,26 +119,6 @@ function allowFullScreen() {
   }
 }
 
-function loadParams() {
-  App.Helpers.ambari.getInstanceParameters().then(function () {
-var timelineBaseUrl = 
App.Helpers.ambari.getParam(App.Helpers.ambari.TIMELINE_URL),
-RMWebUrl = App.Helpers.ambari.getParam(App.Helpers.ambari.RM_URL);
-$.extend(true, App.Configs, {
-  envDefaults: {
-isStandalone: false,
-timelineBaseUrl: timelineBaseUrl.match('://') ?
-timelineBaseUrl :
-'%@//%@'.fmt(location.protocol, timelineBaseUrl),
-RMWebUrl: RMWebUrl.match('://') ?
-RMWebUrl :
-'%@//%@'.fmt(location.protocol, RMWebUrl)
-  }
-});
-
-App.advanceReadiness();
-  });
-}
-
 function onPathChange() {
   var path = window.location.hash.substr(2).trim(),
   pathParts = path.split('?'),
@@ -248,6 +142,38 @@ function scheduleChangeHandler(arguments) {
   setTimeout(onPathChange, 100);
 }
 
+function 

ambari git commit: AMBARI-13783. Tez Ambari View : Make UI use proxy end points provided by AMBARI-13612 (Sreenath Somarajapuram via srimanth)

2015-11-09 Thread srimanth
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 8144dbdd4 -> e6b276c84


AMBARI-13783. Tez Ambari View : Make UI use proxy end points provided by 
AMBARI-13612 (Sreenath Somarajapuram via srimanth)


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

Branch: refs/heads/branch-2.1
Commit: e6b276c84bd85dd57cb29bf4d886f380abb2a1db
Parents: 8144dbd
Author: Srimanth Gunturi 
Authored: Mon Nov 9 21:44:46 2015 -0800
Committer: Srimanth Gunturi 
Committed: Mon Nov 9 21:44:46 2015 -0800

--
 .../resources/ui/scripts/init-ambari-view.js| 146 +--
 1 file changed, 33 insertions(+), 113 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e6b276c8/contrib/views/tez/src/main/resources/ui/scripts/init-ambari-view.js
--
diff --git 
a/contrib/views/tez/src/main/resources/ui/scripts/init-ambari-view.js 
b/contrib/views/tez/src/main/resources/ui/scripts/init-ambari-view.js
index 5c616e5..5152fb9 100644
--- a/contrib/views/tez/src/main/resources/ui/scripts/init-ambari-view.js
+++ b/contrib/views/tez/src/main/resources/ui/scripts/init-ambari-view.js
@@ -102,92 +102,6 @@ function redirectionCheck() {
   }
 }
 
-App.Helpers.ambari = (function () {
-  /**
-   * Stores parameters from Ambari.
-   */
-  var ambariParameters = {},
-
-  /**
-   * Constructs URL for fetching Ambari view instance parameters.
-   * @return {String}
-   */
-  getURL = function () {
-var urlParts = location.pathname.split('/');
-
-return "/api/v1/views/%@/versions/%@/instances/%@/resources/status".fmt(
-  urlParts[2],
-  urlParts[3],
-  urlParts[4]
-);
-  };
-
-  return {
-/**
- * Key for the property representing ATS url.
- */
-TIMELINE_URL: 'yarn.timeline-server.url',
-RM_URL: 'yarn.resourcemanager.url',
-
-/**
- * Returns parameter value.
- * @param {String} name
- * @return {String}
- * @method getParam
- */
-getParam: function (name) {
-  Ember.assert('Parameter not found!', ambariParameters[name]);
-  return ambariParameters[name];
-},
-
-/**
- * Get view instance properties provided by user.
- * @returns {$.ajax}
- * @method getInstanceParameters
- */
-getInstanceParameters: function () {
-  var hashArray = location.pathname.split('/'),
-  params = {
-view: hashArray[2],
-version: hashArray[3],
-instanceName: hashArray[4],
-clusterName: App.get('clusterName')
-  };
-
-  return $.ajax({
-type: 'GET',
-dataType: 'json',
-async: true,
-context: this,
-url: getURL(),
-success: this.getInstanceParametersSuccessCallback,
-error: this.getInstanceParametersErrorCallback
-  });
-},
-
-/**
- * Success callback for getInstanceParameters-request.
- * @param {object} data
- * @method getInstanceParametersSuccessCallback
- */
-getInstanceParametersSuccessCallback: function (data) {
-  Ember.assert('Ambari instance parameter weren`t returned by the 
service!', data.parameters);
-  ambariParameters = data.parameters;
-},
-
-/**
- * Error callback for getInstanceParameters-request.
- * @method getInstanceParametersErrorCallback
- */
-getInstanceParametersErrorCallback: function (request, ajaxOptions, error) 
{
-  var json = request.responseJSON;
-  App.Helpers.ErrorBar.getInstance().show(json.message, json.trace);
-  Ember.assert(json.message);
-}
-  };
-
-})();
-
 function allowFullScreen() {
   if(window.parent) {
 var arrFrames = parent.document.getElementsByTagName("IFRAME"),
@@ -205,26 +119,6 @@ function allowFullScreen() {
   }
 }
 
-function loadParams() {
-  App.Helpers.ambari.getInstanceParameters().then(function () {
-var timelineBaseUrl = 
App.Helpers.ambari.getParam(App.Helpers.ambari.TIMELINE_URL),
-RMWebUrl = App.Helpers.ambari.getParam(App.Helpers.ambari.RM_URL);
-$.extend(true, App.Configs, {
-  envDefaults: {
-isStandalone: false,
-timelineBaseUrl: timelineBaseUrl.match('://') ?
-timelineBaseUrl :
-'%@//%@'.fmt(location.protocol, timelineBaseUrl),
-RMWebUrl: RMWebUrl.match('://') ?
-RMWebUrl :
-'%@//%@'.fmt(location.protocol, RMWebUrl)
-  }
-});
-
-App.advanceReadiness();
-  });
-}
-
 function onPathChange() {
   var path = window.location.hash.substr(2).trim(),
   pathParts = path.split('?'),
@@ -248,6 +142,38 @@ function scheduleChangeHandler(arguments) {
   setTimeout(onPathChange, 100);
 }
 

ambari git commit: AMBARI-13803. Reconfiguring Kafka service via ambari-web generates an error in stack advisor. (jaimin)

2015-11-09 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/trunk 70f2cfe74 -> 47e8d3ad9


AMBARI-13803. Reconfiguring Kafka service via ambari-web generates an error in 
stack advisor. (jaimin)


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

Branch: refs/heads/trunk
Commit: 47e8d3ad99e7c759b47c65cded25aa778cd50413
Parents: 70f2cfe
Author: Jaimin Jetly 
Authored: Mon Nov 9 15:57:08 2015 -0800
Committer: Jaimin Jetly 
Committed: Mon Nov 9 15:58:12 2015 -0800

--
 .../stacks/HDP/2.3/services/stack_advisor.py| 20 ++--
 .../stacks/2.3/common/test_stack_advisor.py |  6 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/47e8d3ad/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
index 9e188dc..5a1a5f9 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
@@ -323,7 +323,11 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
   
putHdfsSitePropertyAttribute('dfs.namenode.inode.attributes.provider.class', 
'delete', 'true')
 
   def recommendKAFKAConfigurations(self, configurations, clusterData, 
services, hosts):
-core_site = services["configurations"]["core-site"]["properties"]
+kafka_broker = getServicesSiteProperties(services, "kafka-broker")
+
+# kerberos security for kafka is decided from 
`security.inter.broker.protocol` property value
+security_enabled = (kafka_broker is not None and 
'security.inter.broker.protocol' in  kafka_broker
+and 'SASL' in 
kafka_broker['security.inter.broker.protocol'])
 putKafkaBrokerProperty = self.putProperty(configurations, "kafka-broker", 
services)
 putKafkaLog4jProperty = self.putProperty(configurations, "kafka-log4j", 
services)
 putKafkaBrokerAttributes = self.putPropertyAttribute(configurations, 
"kafka-broker")
@@ -385,20 +389,16 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
 
 
   else:
-  # Cluster is kerberized
-if 'hadoop.security.authentication' in core_site and 
core_site['hadoop.security.authentication'] == 'kerberos' and \
+# Kerberized Cluster with Ranger plugin disabled
+if security_enabled and \
   
services['configurations']['kafka-broker']['properties']['authorizer.class.name']
 == 'org.apache.ranger.authorization.kafka.authorizer.RangerKafkaAuthorizer':
   putKafkaBrokerProperty("authorizer.class.name", 
'kafka.security.auth.SimpleAclAuthorizer')
+# Non-kerberos Cluster with Ranger plugin disabled
 else:
   putKafkaBrokerAttributes('authorizer.class.name', 'delete', 'true')
-  # Cluster with Ranger is not kerberized
-elif ('hadoop.security.authentication' not in core_site or 
core_site['hadoop.security.authentication'] != 'kerberos'):
-  putKafkaBrokerAttributes('authorizer.class.name', 'delete', 'true')
-
-
 
-# Cluster without Ranger is not kerberized
-elif ('hadoop.security.authentication' not in core_site or 
core_site['hadoop.security.authentication'] != 'kerberos'):
+# Non-Kerberos Cluster without Ranger
+elif not security_enabled:
   putKafkaBrokerAttributes('authorizer.class.name', 'delete', 'true')
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/47e8d3ad/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py 
b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
index 2b09134..fc4f2e9 100644
--- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
@@ -430,7 +430,7 @@ class TestHDP23StackAdvisor(TestCase):
 # Test authorizer.class.name with Ranger Kafka plugin disabled in kerberos 
environment
 configurations['kafka-broker']['properties'] = {}
 configurations['kafka-broker']['property_attributes'] = {}
-
services['configurations']['core-site']['properties']['hadoop.security.authentication']
 = 'kerberos'
+
services['configurations']['kafka-broker']['properties']['security.inter.broker.protocol']
 = 'PLAINTEXTSASL'
 
services['configurations']['kafka-broker']['properties']['authorizer.class.name']
 =

ambari git commit: AMBARI-13803. Reconfiguring Kafka service via ambari-web generates an error in stack advisor. (jaimin)

2015-11-09 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 bc995b20f -> 8144dbdd4


AMBARI-13803. Reconfiguring Kafka service via ambari-web generates an error in 
stack advisor. (jaimin)


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

Branch: refs/heads/branch-2.1
Commit: 8144dbdd4a3c4484ae2eb22b40abd9605dfa0fa7
Parents: bc995b2
Author: Jaimin Jetly 
Authored: Mon Nov 9 15:57:08 2015 -0800
Committer: Jaimin Jetly 
Committed: Mon Nov 9 15:57:08 2015 -0800

--
 .../stacks/HDP/2.3/services/stack_advisor.py| 20 ++--
 .../stacks/2.3/common/test_stack_advisor.py |  6 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8144dbdd/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
index 820487d..3deb87a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py
@@ -253,7 +253,11 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
   
putHdfsSitePropertyAttribute('dfs.namenode.inode.attributes.provider.class', 
'delete', 'true')
 
   def recommendKAFKAConfigurations(self, configurations, clusterData, 
services, hosts):
-core_site = services["configurations"]["core-site"]["properties"]
+kafka_broker = getServicesSiteProperties(services, "kafka-broker")
+
+# kerberos security for kafka is decided from 
`security.inter.broker.protocol` property value
+security_enabled = (kafka_broker is not None and 
'security.inter.broker.protocol' in  kafka_broker
+and 'SASL' in 
kafka_broker['security.inter.broker.protocol'])
 putKafkaBrokerProperty = self.putProperty(configurations, "kafka-broker", 
services)
 putKafkaLog4jProperty = self.putProperty(configurations, "kafka-log4j", 
services)
 putKafkaBrokerAttributes = self.putPropertyAttribute(configurations, 
"kafka-broker")
@@ -315,20 +319,16 @@ class HDP23StackAdvisor(HDP22StackAdvisor):
 
 
   else:
-  # Cluster is kerberized
-if 'hadoop.security.authentication' in core_site and 
core_site['hadoop.security.authentication'] == 'kerberos' and \
+# Kerberized Cluster with Ranger plugin disabled
+if security_enabled and \
   
services['configurations']['kafka-broker']['properties']['authorizer.class.name']
 == 'org.apache.ranger.authorization.kafka.authorizer.RangerKafkaAuthorizer':
   putKafkaBrokerProperty("authorizer.class.name", 
'kafka.security.auth.SimpleAclAuthorizer')
+# Non-kerberos Cluster with Ranger plugin disabled
 else:
   putKafkaBrokerAttributes('authorizer.class.name', 'delete', 'true')
-  # Cluster with Ranger is not kerberized
-elif ('hadoop.security.authentication' not in core_site or 
core_site['hadoop.security.authentication'] != 'kerberos'):
-  putKafkaBrokerAttributes('authorizer.class.name', 'delete', 'true')
-
-
 
-# Cluster without Ranger is not kerberized
-elif ('hadoop.security.authentication' not in core_site or 
core_site['hadoop.security.authentication'] != 'kerberos'):
+# Non-Kerberos Cluster without Ranger
+elif not security_enabled:
   putKafkaBrokerAttributes('authorizer.class.name', 'delete', 'true')
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8144dbdd/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py 
b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
index c5620d7..a1114fc 100644
--- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py
@@ -255,7 +255,7 @@ class TestHDP23StackAdvisor(TestCase):
 # Test authorizer.class.name with Ranger Kafka plugin disabled in kerberos 
environment
 configurations['kafka-broker']['properties'] = {}
 configurations['kafka-broker']['property_attributes'] = {}
-
services['configurations']['core-site']['properties']['hadoop.security.authentication']
 = 'kerberos'
+
services['configurations']['kafka-broker']['properties']['security.inter.broker.protocol']
 = 'PLAINTEXTSASL'
 
services['configurations']['kafka-broker']['properties']['authorizer.class

ambari git commit: AMBARI-13802. Update message content for Finalize Upgrade Pre-Check.(xiwang)

2015-11-09 Thread xiwang
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 420dc339a -> bc995b20f


AMBARI-13802. Update message content for Finalize Upgrade Pre-Check.(xiwang)


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

Branch: refs/heads/branch-2.1
Commit: bc995b20ffa3d76dc4ae368ff7955526d5742b83
Parents: 420dc33
Author: Xi Wang 
Authored: Mon Nov 9 11:38:05 2015 -0800
Committer: Xi Wang 
Committed: Mon Nov 9 14:34:02 2015 -0800

--
 .../stack_upgrade/stack_upgrade_wizard.hbs  | 50 +++-
 .../admin/stack_upgrade/upgrade_wizard_view.js  | 10 +++-
 2 files changed, 36 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/bc995b20/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 be6596b..45270ed 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
@@ -188,23 +188,23 @@
 {{/if}}
 {{#if view.isSlaveComponentFailuresItem}}
   
-  {{t admin.stackUpgrade.dialog.manual}}
-  {{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.title}}
-
-{{#if areSlaveComponentFailuresHostsLoaded}}
-  {{#if slaveComponentFailuresHosts.length}}
-{{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.msg1}}
-
-  {{#each hostName in slaveComponentFailuresHosts}}
-{{hostName}}
-  {{/each}}
-
-{{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.msg2}}
-  {{/if}}
-{{else}}
+{{t admin.stackUpgrade.dialog.manual}}
+{{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.title}}
+
+  {{#if areSlaveComponentFailuresHostsLoaded}}
+{{t admin.stackUpgrade.failedHosts.message}}
+  {{view.failedHostsMessage}}
+  {{else}}
 
-{{/if}}
-
+  {{/if}}
+
+
+  {{t admin.stackUpgrade.failedHosts.options}}
+
+  {{t admin.stackUpgrade.failedHosts.options.first}}
+  {{t admin.stackUpgrade.failedHosts.options.second}}
+
+
   
 {{view Em.Checkbox checkedBinding="view.isManualDone"}}
 {{t admin.stackUpgrade.dialog.manualDone}}
@@ -226,7 +226,7 @@
 {{/if}}
 {{#if view.isServiceCheckFailuresItem}}
   
-  {{t admin.stackUpgrade.dialog.manual}}
+{{t admin.stackUpgrade.dialog.manual}}
 
 {{#if areServiceCheckFailuresServicenamesLoaded}}
   {{#if serviceCheckFailuresServicenames.length}}
@@ -241,13 +241,17 @@
   {{/if}}
   {{#if slaveComponentFailuresHosts.length}}
 {{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.title}}
-{{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.msg1}}
-
-  {{#each hostName in slaveComponentFailuresHosts}}
-{{hostName}}
-  {{/each}}
+
+  {{t admin.stackUpgrade.failedHosts.message}}
+  {{view.failedHostsMessage}}
+
+
+  {{t admin.stackUpgrade.failedHosts.options}}
+
+  {{t admin.stackUpgrade.failedHosts.options.first}}
+  {{t admin.stackUpgrade.failedHosts.options.second}}
 
-{{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.msg2}}
+
   {{/if}}
 {{else}}
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/bc995b20/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
--
diff --git 
a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js 
b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
index b34600b..0aa9ec1 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_wizard_view.js
@@ -230,8 +230,16 @@ App.upgradeWizardV

ambari git commit: AMBARI-13802. Update message content for Finalize Upgrade Pre-Check.(xiwang)

2015-11-09 Thread xiwang
Repository: ambari
Updated Branches:
  refs/heads/trunk d7a965535 -> 70f2cfe74


AMBARI-13802. Update message content for Finalize Upgrade Pre-Check.(xiwang)


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

Branch: refs/heads/trunk
Commit: 70f2cfe74bb54ce9579eb073c4348b179ce76ad1
Parents: d7a9655
Author: Xi Wang 
Authored: Mon Nov 9 12:06:37 2015 -0800
Committer: Xi Wang 
Committed: Mon Nov 9 14:33:14 2015 -0800

--
 ambari-web/app/messages.js  |  5 +++
 .../stack_upgrade/stack_upgrade_wizard.hbs  | 45 +++-
 .../admin/stack_upgrade/upgrade_wizard_view.js  | 31 ++
 3 files changed, 61 insertions(+), 20 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/70f2cfe7/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 2cb7a97..d255877 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1500,6 +1500,11 @@ Em.I18n.translations = {
 " You cannot go back to the original version once the downgrade is 
finalized.",
   'admin.stackUpgrade.finalize.message.skippedServiceChecks': "During the 
upgrade, checks for the following services failed and were skipped:",
   'admin.stackUpgrade.finalize.message.testServices': "You are strongly 
recommended to test these services before finalizing upgrade.",
+  'admin.stackUpgrade.failedHosts.message': "Upgrade did not succeed on",
+  'admin.stackUpgrade.failedHosts.showHosts': "{0} hosts",
+  'admin.stackUpgrade.failedHosts.options': "Your options:",
+  'admin.stackUpgrade.failedHosts.options.first': "Pause Upgrade, 
delete the unhealthy hosts and return to the Upgrade Wizard to Proceed.",
+  'admin.stackUpgrade.failedHosts.options.second': "Perform a 
Downgrade, which will revert all hosts to the previous stack version.",
   'admin.stackUpgrade.doThisLater': "Do This Later",
   'admin.stackUpgrade.pauseUpgrade': "Pause Upgrade",
   'admin.stackUpgrade.pauseDowngrade': "Pause Downgrade",  

http://git-wip-us.apache.org/repos/asf/ambari/blob/70f2cfe7/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 92c735f..eeefbe1 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
@@ -92,20 +92,21 @@
 
   {{t admin.stackUpgrade.dialog.manual}}
   {{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.title}}
-
-  {{#if areSlaveComponentFailuresHostsLoaded}}
-{{#if slaveComponentFailuresHosts.length}}
-  {{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.msg1}}
-  
-{{#each hostName in slaveComponentFailuresHosts}}
-  {{hostName}}
-{{/each}}
-  
-  {{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.msg2}}
-{{/if}}
-  {{else}}
+  
+{{#if areSlaveComponentFailuresHostsLoaded}}
+  {{t admin.stackUpgrade.failedHosts.message}}
+{{view.failedHostsMessage}}
+{{else}}
   
-  {{/if}}
+{{/if}}
+  
+  
+{{t admin.stackUpgrade.failedHosts.options}}
+
+  {{t admin.stackUpgrade.failedHosts.options.first}}
+  {{t admin.stackUpgrade.failedHosts.options.second}}
+
+  
 
   
 {{view Em.Checkbox checkedBinding="view.isManualDone"}}
@@ -143,13 +144,17 @@
   {{/if}}
   {{#if slaveComponentFailuresHosts.length}}
 {{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.title}}
-{{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.msg1}}
-
-  {{#each hostName in slaveComponentFailuresHosts}}
-{{hostName}}
-  {{/each}}
-
-{{t 
admin.stackUpgrade.dialog.manual.slaveComponentFailures.msg2}}
+
+  {{t admin.stackUpgrade.failedHosts.message}}
+

ambari git commit: AMBARI-13347. Alert notification create/edit/duplicate menu items should be disabled for non-admin users. (Sangeeta Ravindran via yusaku)

2015-11-09 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk c715189ab -> d7a965535


AMBARI-13347. Alert notification create/edit/duplicate menu items should be 
disabled for non-admin users. (Sangeeta Ravindran via yusaku)


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

Branch: refs/heads/trunk
Commit: d7a9655350126d2958382a5095b9499bf450bf07
Parents: c715189
Author: Yusaku Sako 
Authored: Mon Nov 9 14:21:06 2015 -0800
Committer: Yusaku Sako 
Committed: Mon Nov 9 14:21:06 2015 -0800

--
 .../alerts/manage_alert_notifications_popup.hbs |  3 +-
 .../alerts/manage_alert_notifications_view.js   | 13 --
 .../manage_alert_notifications_view_test.js | 45 +++-
 3 files changed, 55 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a96553/ambari-web/app/templates/main/alerts/manage_alert_notifications_popup.hbs
--
diff --git 
a/ambari-web/app/templates/main/alerts/manage_alert_notifications_popup.hbs 
b/ambari-web/app/templates/main/alerts/manage_alert_notifications_popup.hbs
index b0fa709..3581f12 100644
--- a/ambari-web/app/templates/main/alerts/manage_alert_notifications_popup.hbs
+++ b/ambari-web/app/templates/main/alerts/manage_alert_notifications_popup.hbs
@@ -32,13 +32,14 @@
   
 
 
 
-  
+  
  
   
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a96553/ambari-web/app/views/main/alerts/manage_alert_notifications_view.js
--
diff --git 
a/ambari-web/app/views/main/alerts/manage_alert_notifications_view.js 
b/ambari-web/app/views/main/alerts/manage_alert_notifications_view.js
index ff55ae9..4672662 100644
--- a/ambari-web/app/views/main/alerts/manage_alert_notifications_view.js
+++ b/ambari-web/app/views/main/alerts/manage_alert_notifications_view.js
@@ -31,6 +31,8 @@ App.ManageAlertNotificationsView = Em.View.extend({
 return 
this.get('controller.selectedAlertNotification.groups').toArray().mapProperty('displayName').join(',
 ');
   }.property('controller.selectedAlertNotification', 
'controller.selectedAlertNotification.groups.@each', 'controller.isLoaded'),
 
+  isAddButtonDisabled: true,
+
   isEditButtonDisabled: true,
 
   isRemoveButtonDisabled: true,
@@ -67,9 +69,10 @@ App.ManageAlertNotificationsView = Em.View.extend({
*/
   buttonObserver: function () {
 var selectedAlertNotification = 
this.get('controller.selectedAlertNotification');
-this.set('isEditButtonDisabled', !selectedAlertNotification);
-this.set('isRemoveButtonDisabled', !selectedAlertNotification);
-this.set('isDuplicateButtonDisabled', !selectedAlertNotification);
+this.set('isAddButtonDisabled', (!selectedAlertNotification || 
App.isOperator));
+this.set('isEditButtonDisabled', (!selectedAlertNotification || 
App.isOperator));
+this.set('isRemoveButtonDisabled', (!selectedAlertNotification || 
App.isOperator));
+this.set('isDuplicateButtonDisabled', (!selectedAlertNotification || 
App.isOperator));
   }.observes('controller.selectedAlertNotification'),
 
   /**
@@ -98,6 +101,10 @@ App.ManageAlertNotificationsView = Em.View.extend({
 this.set('selectedAlertNotification', 
this.get('controller.selectedAlertNotification') || notifications[0]);
 this.buttonObserver();
   }  else {
+if(!App.isOperator)
+{
+   this.set('isAddButtonDisabled',false);
+}
 this.set('selectedAlertNotification', null);
   }
   Em.run.later(this, function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7a96553/ambari-web/test/views/main/alerts/manage_alert_notifications_view_test.js
--
diff --git 
a/ambari-web/test/views/main/alerts/manage_alert_notifications_view_test.js 
b/ambari-web/test/views/main/alerts/manage_alert_notifications_view_test.js
index a2822ce..6e8b993 100644
--- a/ambari-web/test/views/main/alerts/manage_alert_notifications_view_test.js
+++ b/ambari-web/test/views/main/alerts/manage_alert_notifications_view_test.js
@@ -34,28 +34,68 @@ describe('App.ManageAlertNotificationsView', function () {
 
 Em.A([
   {
+isOperator: false,
 selectedAlertNotification: {id: 1},
-m: 'some alert notification is selected',
+m: 'some alert notification is selected and user is an admin',
 p: {
+  isAddButtonDisabled: true,
   isEditButtonDisabled: true,
   isRe

ambari git commit: AMBARI-13801 - Upgrade Pre-Req Check Is Confusing When Hosts Are In Maintenance Mode (jonathanhurley)

2015-11-09 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 fcd58ed06 -> 420dc339a


AMBARI-13801 - Upgrade Pre-Req Check Is Confusing When Hosts Are In Maintenance 
Mode (jonathanhurley)


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

Branch: refs/heads/branch-2.1
Commit: 420dc339abdb733f80dcbd37a42bc48cbf2c56b2
Parents: fcd58ed
Author: Jonathan Hurley 
Authored: Mon Nov 9 14:24:28 2015 -0500
Committer: Jonathan Hurley 
Committed: Mon Nov 9 17:16:32 2015 -0500

--
 .../ambari/server/checks/CheckDescription.java  | 14 +++-
 .../server/checks/HostMaintenanceModeCheck.java | 76 +
 .../server/checks/HostsHeartbeatCheck.java  | 28 ++-
 .../server/state/stack/PrerequisiteCheck.java   |  5 +-
 .../checks/HostMaintenanceModeCheckTest.java| 87 
 .../server/checks/HostsHeartbeatCheckTest.java  | 23 +++---
 6 files changed, 195 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/420dc339/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
index 603b279..1908c06 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
@@ -26,6 +26,7 @@ import org.apache.ambari.server.state.stack.PrereqCheckType;
  * Enum that wraps the various type, text and failure messages for the checks
  * done for Rolling Upgrades.
  */
+@SuppressWarnings("serial")
 public enum CheckDescription {
 
   CLIENT_RETRY(PrereqCheckType.SERVICE,
@@ -38,12 +39,17 @@ public enum CheckDescription {
   }}),
 
   HOSTS_HEARTBEAT(PrereqCheckType.HOST,
-  "All hosts must be heartbeating with the Ambari Server unless they are 
in Maintenance Mode",
+  "All hosts must be communicating with Ambari. Hosts which are not 
reachable should be placed in Maintenance Mode.",
   new HashMap() {{
 put(AbstractCheckDescriptor.DEFAULT,
-"The following hosts must be heartbeating to the Ambari Server or 
be put into maintenance mode.");
-put(HostsHeartbeatCheck.KEY_HOSTS_IN_MM_WARNING,
-"The following hosts are in maintenance mode and will not be a 
part of the upgrade.");
+"There are hosts which are not communicating with Ambari.");
+  }}),
+
+  HOSTS_MAINTENANCE_MODE(PrereqCheckType.HOST,
+  "Hosts in Maintenance Mode will be excluded from the upgrade.",
+  new HashMap() {{
+put(AbstractCheckDescriptor.DEFAULT,
+"There are hosts in Maintenance Mode which excludes them from 
being upgraded.");
   }}),
 
   HOSTS_MASTER_MAINTENANCE(PrereqCheckType.HOST,

http://git-wip-us.apache.org/repos/asf/ambari/blob/420dc339/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
new file mode 100644
index 000..8708ef4
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
@@ -0,0 +1,76 @@
+/*
+ * 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 java.util.Collection;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.PrereqCheckRequest;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Host;
+import org.apache.amba

ambari git commit: AMBARI-13801 - Upgrade Pre-Req Check Is Confusing When Hosts Are In Maintenance Mode (jonathanhurley)

2015-11-09 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk de5093a5c -> c715189ab


AMBARI-13801 - Upgrade Pre-Req Check Is Confusing When Hosts Are In Maintenance 
Mode (jonathanhurley)


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

Branch: refs/heads/trunk
Commit: c715189ab50311f5fc2ed0b089e426173b59fd25
Parents: de5093a
Author: Jonathan Hurley 
Authored: Mon Nov 9 14:24:28 2015 -0500
Committer: Jonathan Hurley 
Committed: Mon Nov 9 16:55:38 2015 -0500

--
 .../ambari/server/checks/CheckDescription.java  | 14 +++-
 .../server/checks/HostMaintenanceModeCheck.java | 76 +
 .../server/checks/HostsHeartbeatCheck.java  | 28 ++-
 .../server/state/stack/PrerequisiteCheck.java   |  5 +-
 .../checks/HostMaintenanceModeCheckTest.java| 87 
 .../server/checks/HostsHeartbeatCheckTest.java  | 23 +++---
 6 files changed, 195 insertions(+), 38 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c715189a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
index 603b279..1908c06 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
@@ -26,6 +26,7 @@ import org.apache.ambari.server.state.stack.PrereqCheckType;
  * Enum that wraps the various type, text and failure messages for the checks
  * done for Rolling Upgrades.
  */
+@SuppressWarnings("serial")
 public enum CheckDescription {
 
   CLIENT_RETRY(PrereqCheckType.SERVICE,
@@ -38,12 +39,17 @@ public enum CheckDescription {
   }}),
 
   HOSTS_HEARTBEAT(PrereqCheckType.HOST,
-  "All hosts must be heartbeating with the Ambari Server unless they are 
in Maintenance Mode",
+  "All hosts must be communicating with Ambari. Hosts which are not 
reachable should be placed in Maintenance Mode.",
   new HashMap() {{
 put(AbstractCheckDescriptor.DEFAULT,
-"The following hosts must be heartbeating to the Ambari Server or 
be put into maintenance mode.");
-put(HostsHeartbeatCheck.KEY_HOSTS_IN_MM_WARNING,
-"The following hosts are in maintenance mode and will not be a 
part of the upgrade.");
+"There are hosts which are not communicating with Ambari.");
+  }}),
+
+  HOSTS_MAINTENANCE_MODE(PrereqCheckType.HOST,
+  "Hosts in Maintenance Mode will be excluded from the upgrade.",
+  new HashMap() {{
+put(AbstractCheckDescriptor.DEFAULT,
+"There are hosts in Maintenance Mode which excludes them from 
being upgraded.");
   }}),
 
   HOSTS_MASTER_MAINTENANCE(PrereqCheckType.HOST,

http://git-wip-us.apache.org/repos/asf/ambari/blob/c715189a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
new file mode 100644
index 000..8708ef4
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
@@ -0,0 +1,76 @@
+/*
+ * 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 java.util.Collection;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.PrereqCheckRequest;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Host;
+import org.apache.ambari.server.

[2/2] ambari git commit: Revert "AMBARI-13342. Allow access to callers with valid Knox authorization cookie. (mpapirkovskyy)"

2015-11-09 Thread jonathanhurley
Revert "AMBARI-13342. Allow access to callers with valid Knox authorization 
cookie. (mpapirkovskyy)"

This reverts commit 8997ce0d50d91c4cb008d303a07dfd7a949d1788.


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

Branch: refs/heads/trunk
Commit: de5093a5c8e56959d050e309f7bd5f52ecad36bc
Parents: 8457041
Author: Jonathan Hurley 
Authored: Mon Nov 9 16:55:14 2015 -0500
Committer: Jonathan Hurley 
Committed: Mon Nov 9 16:55:37 2015 -0500

--
 ambari-server/pom.xml   |  12 -
 .../ambari/server/api/AmbariErrorHandler.java   |  13 +-
 .../server/configuration/Configuration.java |  53 ---
 .../AmbariManagementControllerImpl.java |   6 +-
 .../ambari/server/controller/AmbariServer.java  |   3 -
 .../ambari/server/controller/UserResponse.java  |  24 +-
 .../internal/UserPrivilegeResourceProvider.java |   4 -
 .../internal/UserResourceProvider.java  |   4 -
 .../apache/ambari/server/orm/dao/UserDAO.java   |  14 -
 .../ambari/server/orm/entities/UserEntity.java  |  31 +-
 .../AmbariAuthorizationFilter.java  |   8 +-
 .../server/security/authorization/User.java |  11 +-
 .../server/security/authorization/UserType.java |  24 --
 .../server/security/authorization/Users.java|  82 +
 .../authorization/jwt/JwtAuthentication.java|  78 -
 .../jwt/JwtAuthenticationFilter.java| 329 ---
 .../jwt/JwtAuthenticationProperties.java|  85 -
 .../security/encryption/CertificateUtils.java   |  51 ---
 .../server/upgrade/UpgradeCatalog220.java   |  12 -
 ambari-server/src/main/python/ambari-server.py  |   8 +-
 .../main/python/ambari_server/setupActions.py   |   3 +-
 .../src/main/python/ambari_server/setupSso.py   | 121 ---
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |   3 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |   3 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql|   5 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql |   5 +-
 .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql |   3 +-
 .../resources/Ambari-DDL-SQLServer-CREATE.sql   |   9 +-
 .../src/main/resources/properties.json  |   1 -
 .../webapp/WEB-INF/spring-security.xml  |   5 +-
 .../server/api/AmbariErrorHandlerTest.java  |   4 +-
 .../jwt/JwtAuthenticationFilterTest.java| 244 --
 32 files changed, 44 insertions(+), 1214 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/de5093a5/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index ebe5cc2..5a7ddc4 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -2011,18 +2011,6 @@
   ehcache
   2.10.0
 
-
-  com.nimbusds
-  nimbus-jose-jwt
-  3.9
-  compile
-  
-
-  org.bouncycastle
-  bcprov-jdk15on
-
-  
-
   
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/de5093a5/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariErrorHandler.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariErrorHandler.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariErrorHandler.java
index d526ac7..ee4e56f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariErrorHandler.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariErrorHandler.java
@@ -21,8 +21,6 @@ package org.apache.ambari.server.api;
 import com.google.gson.Gson;
 import com.google.inject.Inject;
 import com.google.inject.name.Named;
-import org.apache.ambari.server.configuration.Configuration;
-import 
org.apache.ambari.server.security.authorization.jwt.JwtAuthenticationProperties;
 import org.eclipse.jetty.http.HttpStatus;
 import org.eclipse.jetty.http.MimeTypes;
 import org.eclipse.jetty.server.AbstractHttpConnection;
@@ -37,12 +35,10 @@ import java.util.Map;
 
 public class AmbariErrorHandler extends ErrorHandler {
   private final Gson gson;
-  private Configuration configuration;
 
   @Inject
-  public AmbariErrorHandler(@Named("prettyGson") Gson prettyGson, 
Configuration configuration) {
+  public AmbariErrorHandler(@Named("prettyGson") Gson prettyGson) {
 this.gson = prettyGson;
-this.configuration = configuration;
   }
 
   @Override
@@ -61,13 +57,6 @@ public class AmbariErrorHandler extends ErrorHandler {
 }
 errorMap.put("message", message);
 
-if (code == HttpServletResponse.SC_FORBIDDEN) {
-  JwtAuthenticationProperties jwtProperties

[1/2] ambari git commit: Revert "AMBARI-13342. Allow access to callers with valid Knox authorization cookie. (mpapirkovskyy)"

2015-11-09 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk 845704114 -> de5093a5c


http://git-wip-us.apache.org/repos/asf/ambari/blob/de5093a5/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilterTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilterTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilterTest.java
deleted file mode 100644
index ae47694..000
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilterTest.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * 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.security.authorization.jwt;
-
-import com.nimbusds.jose.JOSEException;
-import com.nimbusds.jose.JWSAlgorithm;
-import com.nimbusds.jose.JWSHeader;
-import com.nimbusds.jose.crypto.RSASSASigner;
-import com.nimbusds.jwt.JWTClaimsSet;
-import com.nimbusds.jwt.SignedJWT;
-import org.apache.ambari.server.security.authorization.AmbariGrantedAuthority;
-import org.apache.ambari.server.security.authorization.User;
-import org.apache.ambari.server.security.authorization.UserType;
-import org.apache.ambari.server.security.authorization.Users;
-import org.easymock.EasyMock;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.core.context.SecurityContextHolder;
-import org.springframework.security.web.AuthenticationEntryPoint;
-
-import javax.servlet.FilterChain;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.NoSuchAlgorithmException;
-import java.security.PrivateKey;
-import java.security.interfaces.RSAPrivateKey;
-import java.security.interfaces.RSAPublicKey;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.createMockBuilder;
-import static org.easymock.EasyMock.createNiceMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.junit.Assert.*;
-
-public class JwtAuthenticationFilterTest {
-  private static RSAPublicKey publicKey;
-  private static RSAPrivateKey privateKey;
-  private static RSAPrivateKey invalidPrivateKey;
-
-
-  @BeforeClass
-  public static void generateKeyPair() throws NoSuchAlgorithmException {
-KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
-keyPairGenerator.initialize(512);
-KeyPair keyPair = keyPairGenerator.generateKeyPair();
-publicKey = (RSAPublicKey) keyPair.getPublic();
-privateKey = (RSAPrivateKey) keyPair.getPrivate();
-
-keyPair = keyPairGenerator.generateKeyPair();
-invalidPrivateKey = (RSAPrivateKey) keyPair.getPrivate();
-  }
-
-  private JwtAuthenticationProperties createTestProperties() {
-JwtAuthenticationProperties properties = new JwtAuthenticationProperties();
-properties.setCookieName("non-default");
-properties.setPublicKey(publicKey);
-properties.setAudiences(Collections.singletonList("test-audience"));
-
-return properties;
-  }
-
-  private SignedJWT getSignedToken() throws JOSEException {
-RSASSASigner signer = new RSASSASigner(privateKey);
-
-Calendar calendar = Calendar.getInstance();
-calendar.setTimeInMillis(System.currentTimeMillis());
-
-JWTClaimsSet claimsSet = new JWTClaimsSet();
-claimsSet.setSubject("test-user");
-claimsSet.setIssuer("unit-test");
-claimsSet.setIssueTime(calendar.getTime());
-
-calendar.add(Calendar.DATE, 1); //add one day
-claimsSet.setExpirationTime(calendar.getTime());
-
-claimsSet.setAudience("te

ambari git commit: AMBARI-13679. UpgradeCatalog212 not idempotent. (Laszlo Puskas via rnettleton)

2015-11-09 Thread rnettleton
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 2c21d2b68 -> fcd58ed06


AMBARI-13679. UpgradeCatalog212 not idempotent. (Laszlo Puskas via rnettleton)


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

Branch: refs/heads/branch-2.1
Commit: fcd58ed068542634afa242f2a15831917d467b60
Parents: 2c21d2b
Author: Bob Nettleton 
Authored: Mon Nov 9 15:50:24 2015 -0500
Committer: Bob Nettleton 
Committed: Mon Nov 9 15:50:24 2015 -0500

--
 .../server/upgrade/AbstractUpgradeCatalog.java  |   3 +
 .../server/upgrade/UpgradeCatalog212.java   |  31 +--
 .../server/upgrade/UpgradeCatalog212Test.java   | 201 +--
 3 files changed, 163 insertions(+), 72 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fcd58ed0/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
index cd3c684..194ac7d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
@@ -99,6 +99,9 @@ public abstract class AbstractUpgradeCatalog implements 
UpgradeCatalog {
 registerCatalog(this);
   }
 
+  protected AbstractUpgradeCatalog() {
+  }
+
   /**
* Every subclass needs to register itself
*/

http://git-wip-us.apache.org/repos/asf/ambari/blob/fcd58ed0/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java
index 342e280..ef974ed 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java
@@ -18,14 +18,8 @@
 
 package org.apache.ambari.server.upgrade;
 
-import java.sql.SQLException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-
+import com.google.inject.Inject;
+import com.google.inject.Injector;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.orm.DBAccessor.DBColumnInfo;
@@ -40,10 +34,13 @@ import org.slf4j.LoggerFactory;
 
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.sql.SQLException;
 import java.sql.Statement;
-
-import com.google.inject.Inject;
-import com.google.inject.Injector;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
 
 
 /**
@@ -89,6 +86,9 @@ public class UpgradeCatalog212 extends AbstractUpgradeCatalog 
{
 daoUtils = injector.getInstance(DaoUtils.class);
   }
 
+  protected UpgradeCatalog212() {
+  }
+
   // - UpgradeCatalog 
 
   /**
@@ -133,8 +133,13 @@ public class UpgradeCatalog212 extends 
AbstractUpgradeCatalog {
*/
   @Override
   protected void executePreDMLUpdates() throws AmbariException, SQLException {
-addClusterIdToTopology();
-finilizeTopologyDDL();
+if (dbAccessor.tableHasColumn(TOPOLOGY_REQUEST_TABLE, 
TOPOLOGY_REQUEST_CLUSTER_NAME_COLUMN)) {
+  addClusterIdToTopology();
+  finilizeTopologyDDL();
+} else {
+  LOG.debug("The column: [ {} ] has already been dropped from table: [ {} 
]. Skipping preDMLUpdate logic.",
+  TOPOLOGY_REQUEST_CLUSTER_NAME_COLUMN, TOPOLOGY_REQUEST_TABLE);
+}
   }
 
   protected void finilizeTopologyDDL() throws AmbariException, SQLException {

http://git-wip-us.apache.org/repos/asf/ambari/blob/fcd58ed0/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java
index d427e1a..572a65c 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java
+++ 
b/ambari-server/src/test/java/org/apa

ambari git commit: AMBARI-13679. UpgradeCatalog212 not idempotent. (Laszlo Puskas via rnettleton)

2015-11-09 Thread rnettleton
Repository: ambari
Updated Branches:
  refs/heads/trunk 253b48987 -> 845704114


AMBARI-13679. UpgradeCatalog212 not idempotent. (Laszlo Puskas via rnettleton)


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

Branch: refs/heads/trunk
Commit: 84570411436f2b93887a5c0bca3d52761573217b
Parents: 253b489
Author: Bob Nettleton 
Authored: Mon Nov 9 15:39:51 2015 -0500
Committer: Bob Nettleton 
Committed: Mon Nov 9 15:39:51 2015 -0500

--
 .../server/upgrade/AbstractUpgradeCatalog.java  |   3 +
 .../server/upgrade/UpgradeCatalog212.java   |  31 +--
 .../server/upgrade/UpgradeCatalog212Test.java   | 201 +--
 3 files changed, 163 insertions(+), 72 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/84570411/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
index cd3c684..194ac7d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
@@ -99,6 +99,9 @@ public abstract class AbstractUpgradeCatalog implements 
UpgradeCatalog {
 registerCatalog(this);
   }
 
+  protected AbstractUpgradeCatalog() {
+  }
+
   /**
* Every subclass needs to register itself
*/

http://git-wip-us.apache.org/repos/asf/ambari/blob/84570411/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java
index 342e280..ef974ed 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog212.java
@@ -18,14 +18,8 @@
 
 package org.apache.ambari.server.upgrade;
 
-import java.sql.SQLException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-
+import com.google.inject.Inject;
+import com.google.inject.Injector;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.orm.DBAccessor.DBColumnInfo;
@@ -40,10 +34,13 @@ import org.slf4j.LoggerFactory;
 
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.sql.SQLException;
 import java.sql.Statement;
-
-import com.google.inject.Inject;
-import com.google.inject.Injector;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
 
 
 /**
@@ -89,6 +86,9 @@ public class UpgradeCatalog212 extends AbstractUpgradeCatalog 
{
 daoUtils = injector.getInstance(DaoUtils.class);
   }
 
+  protected UpgradeCatalog212() {
+  }
+
   // - UpgradeCatalog 
 
   /**
@@ -133,8 +133,13 @@ public class UpgradeCatalog212 extends 
AbstractUpgradeCatalog {
*/
   @Override
   protected void executePreDMLUpdates() throws AmbariException, SQLException {
-addClusterIdToTopology();
-finilizeTopologyDDL();
+if (dbAccessor.tableHasColumn(TOPOLOGY_REQUEST_TABLE, 
TOPOLOGY_REQUEST_CLUSTER_NAME_COLUMN)) {
+  addClusterIdToTopology();
+  finilizeTopologyDDL();
+} else {
+  LOG.debug("The column: [ {} ] has already been dropped from table: [ {} 
]. Skipping preDMLUpdate logic.",
+  TOPOLOGY_REQUEST_CLUSTER_NAME_COLUMN, TOPOLOGY_REQUEST_TABLE);
+}
   }
 
   protected void finilizeTopologyDDL() throws AmbariException, SQLException {

http://git-wip-us.apache.org/repos/asf/ambari/blob/84570411/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java
index d427e1a..572a65c 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog212Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari

ambari git commit: AMBARI-13794 HBASE_SERVICE_CHECK fails if /tmp is mounted with noexec option (dsen)

2015-11-09 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 9b602463a -> 2c21d2b68


AMBARI-13794 HBASE_SERVICE_CHECK fails if /tmp is mounted with noexec option 
(dsen)


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

Branch: refs/heads/branch-2.1
Commit: 2c21d2b68e339da4ce5e431efa9f3a267dd84c27
Parents: 9b60246
Author: Dmytro Sen 
Authored: Mon Nov 9 21:06:33 2015 +0200
Committer: Dmytro Sen 
Committed: Mon Nov 9 21:13:01 2015 +0200

--
 .../server/upgrade/UpgradeCatalog213.java   | 34 +---
 .../0.96.0.2.0/configuration/hbase-env.xml  | 12 +--
 .../HBASE/0.96.0.2.0/package/scripts/hbase.py   |  7 
 .../0.96.0.2.0/package/scripts/params_linux.py  |  1 +
 .../services/HBASE/configuration/hbase-env.xml  |  4 +--
 .../services/HBASE/configuration/hbase-env.xml  |  4 +--
 .../stacks/2.0.6/HBASE/test_hbase_client.py | 12 +++
 .../stacks/2.0.6/HBASE/test_hbase_master.py | 19 ++-
 .../2.0.6/HBASE/test_hbase_regionserver.py  | 24 ++
 .../2.0.6/HBASE/test_phoenix_queryserver.py | 12 +++
 .../stacks/2.0.6/configs/altfs_plus_hdfs.json   |  3 +-
 .../stacks/2.0.6/configs/client-upgrade.json|  5 +--
 .../2.0.6/configs/default.hbasedecom.json   |  3 +-
 .../python/stacks/2.0.6/configs/default.json|  3 +-
 .../2.0.6/configs/default.non_gmetad_host.json  |  3 +-
 .../stacks/2.0.6/configs/default_client.json|  3 +-
 .../2.0.6/configs/default_hive_nn_ha.json   |  3 +-
 .../2.0.6/configs/default_hive_nn_ha_2.json |  3 +-
 .../2.0.6/configs/default_hive_non_hdfs.json|  3 +-
 .../2.0.6/configs/default_no_install.json   |  3 +-
 .../2.0.6/configs/default_oozie_mysql.json  |  3 +-
 .../default_update_exclude_file_only.json   |  3 +-
 .../python/stacks/2.0.6/configs/flume_22.json   |  3 +-
 .../2.0.6/configs/ha_bootstrap_active_node.json |  3 +-
 .../configs/ha_bootstrap_standby_node.json  |  3 +-
 ...ha_bootstrap_standby_node_initial_start.json |  3 +-
 .../python/stacks/2.0.6/configs/ha_default.json |  3 +-
 .../python/stacks/2.0.6/configs/ha_secured.json |  3 +-
 .../python/stacks/2.0.6/configs/hbase-2.2.json  |  3 +-
 .../stacks/2.0.6/configs/hbase-check-2.2.json   |  5 +--
 .../stacks/2.0.6/configs/hbase-preupgrade.json  |  3 +-
 .../2.0.6/configs/hbase-rs-2.2-phoenix.json |  3 +-
 .../stacks/2.0.6/configs/hbase-rs-2.2.json  |  3 +-
 .../stacks/2.0.6/configs/hbase_no_phx.json  |  3 +-
 .../stacks/2.0.6/configs/hbase_with_phx.json|  3 +-
 .../2.0.6/configs/oozie_existing_sqla.json  |  3 +-
 .../python/stacks/2.0.6/configs/secured.json|  3 +-
 .../stacks/2.0.6/configs/secured_client.json|  3 +-
 .../stacks/2.3/configs/hbase_default.json   |  3 +-
 .../python/stacks/2.3/configs/hbase_secure.json |  3 +-
 40 files changed, 171 insertions(+), 52 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2c21d2b6/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
index e4d44a7..3211b36 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
@@ -204,9 +204,9 @@ public class UpgradeCatalog213 extends 
AbstractUpgradeCatalog {
 
   private void executeBlueprintDDLUpdates() throws AmbariException, 
SQLException {
 dbAccessor.addColumn(BLUEPRINT_TABLE, new 
DBAccessor.DBColumnInfo(SECURITY_TYPE_COLUMN,
-  String.class, 32, "NONE", false));
+String.class, 32, "NONE", false));
 dbAccessor.addColumn(BLUEPRINT_TABLE, new 
DBAccessor.DBColumnInfo(SECURITY_DESCRIPTOR_REF_COLUMN,
-  String.class, null, null, true));
+String.class, null, null, true));
   }
 
 /**
@@ -777,19 +777,29 @@ public class UpgradeCatalog213 extends 
AbstractUpgradeCatalog {
 
   protected void updateHbaseEnvConfig() throws AmbariException {
 AmbariManagementController ambariManagementController = 
injector.getInstance(AmbariManagementController.class);
+boolean updateConfig = false;
 
 for (final Cluster cluster : 
getCheckedClusterMap(ambariManagementController.getClusters()).values()) {
   StackId stackId = cluster.getCurrentStackVersion();
-  if (stackId != null && stackId.getStackName().equals("HDP") &&
-   VersionUtils.compareVersions(stackId.getStackVersion(), "2.2") 
>= 0) {

ambari git commit: AMBARI-13794 HBASE_SERVICE_CHECK fails if /tmp is mounted with noexec option (dsen)

2015-11-09 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk 4cccb8708 -> 253b48987


AMBARI-13794 HBASE_SERVICE_CHECK fails if /tmp is mounted with noexec option 
(dsen)


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

Branch: refs/heads/trunk
Commit: 253b489879e9509ae5d0866317d6ed182a67a8b9
Parents: 4cccb87
Author: Dmytro Sen 
Authored: Mon Nov 9 21:06:33 2015 +0200
Committer: Dmytro Sen 
Committed: Mon Nov 9 21:06:33 2015 +0200

--
 .../server/upgrade/UpgradeCatalog213.java   | 30 +---
 .../0.96.0.2.0/configuration/hbase-env.xml  | 12 ++--
 .../HBASE/0.96.0.2.0/package/scripts/hbase.py   |  8 +-
 .../0.96.0.2.0/package/scripts/params_linux.py  |  1 +
 .../services/HBASE/configuration/hbase-env.xml  |  4 +--
 .../services/HBASE/configuration/hbase-env.xml  |  4 +--
 .../stacks/2.0.6/HBASE/test_hbase_client.py | 12 
 .../stacks/2.0.6/HBASE/test_hbase_master.py | 19 -
 .../2.0.6/HBASE/test_hbase_regionserver.py  | 24 
 .../2.0.6/HBASE/test_phoenix_queryserver.py | 12 
 .../stacks/2.0.6/configs/altfs_plus_hdfs.json   |  3 +-
 .../stacks/2.0.6/configs/client-upgrade.json|  5 ++--
 .../2.0.6/configs/default.hbasedecom.json   |  3 +-
 .../python/stacks/2.0.6/configs/default.json|  3 +-
 .../2.0.6/configs/default.non_gmetad_host.json  |  3 +-
 .../stacks/2.0.6/configs/default_client.json|  3 +-
 .../2.0.6/configs/default_hive_nn_ha.json   |  3 +-
 .../2.0.6/configs/default_hive_nn_ha_2.json |  3 +-
 .../2.0.6/configs/default_hive_non_hdfs.json|  3 +-
 .../2.0.6/configs/default_no_install.json   |  3 +-
 .../2.0.6/configs/default_oozie_mysql.json  |  3 +-
 .../default_update_exclude_file_only.json   |  3 +-
 .../python/stacks/2.0.6/configs/flume_22.json   |  3 +-
 .../2.0.6/configs/ha_bootstrap_active_node.json |  3 +-
 .../configs/ha_bootstrap_standby_node.json  |  3 +-
 ...ha_bootstrap_standby_node_initial_start.json |  3 +-
 .../python/stacks/2.0.6/configs/ha_default.json |  3 +-
 .../python/stacks/2.0.6/configs/ha_secured.json |  3 +-
 .../python/stacks/2.0.6/configs/hbase-2.2.json  |  3 +-
 .../stacks/2.0.6/configs/hbase-check-2.2.json   |  5 ++--
 .../stacks/2.0.6/configs/hbase-preupgrade.json  |  3 +-
 .../2.0.6/configs/hbase-rs-2.2-phoenix.json |  3 +-
 .../stacks/2.0.6/configs/hbase-rs-2.2.json  |  3 +-
 .../stacks/2.0.6/configs/hbase_no_phx.json  |  3 +-
 .../stacks/2.0.6/configs/hbase_with_phx.json|  3 +-
 .../2.0.6/configs/oozie_existing_sqla.json  |  3 +-
 .../python/stacks/2.0.6/configs/secured.json|  3 +-
 .../stacks/2.0.6/configs/secured_client.json|  3 +-
 .../stacks/2.3/configs/hbase_default.json   |  3 +-
 .../python/stacks/2.3/configs/hbase_secure.json |  3 +-
 40 files changed, 169 insertions(+), 51 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/253b4898/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
index 6784e71..ed4b22a 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog213.java
@@ -779,19 +779,29 @@ public class UpgradeCatalog213 extends 
AbstractUpgradeCatalog {
 
   protected void updateHbaseEnvConfig() throws AmbariException {
 AmbariManagementController ambariManagementController = 
injector.getInstance(AmbariManagementController.class);
+boolean updateConfig = false;
 
 for (final Cluster cluster : 
getCheckedClusterMap(ambariManagementController.getClusters()).values()) {
   StackId stackId = cluster.getCurrentStackVersion();
-  if (stackId != null && stackId.getStackName().equals("HDP") &&
-VersionUtils.compareVersions(stackId.getStackVersion(), "2.2") >= 0) {
-Config hbaseEnvConfig = 
cluster.getDesiredConfigByType(HBASE_ENV_CONFIG);
-if (hbaseEnvConfig != null) {
-  String content = 
hbaseEnvConfig.getProperties().get(CONTENT_PROPERTY);
-  if (content != null && 
content.indexOf("MaxDirectMemorySize={{hbase_max_direct_memory_size}}m") < 0) {
-String newPartOfContent = "\n\nexport 
HBASE_REGIONSERVER_OPTS=\"$HBASE_REGIONSERVER_OPTS {% if 
hbase_max_direct_memory_size %} 
-XX:MaxDirectMemorySize={{hbase_max_direct_memory_size}}m {% endif %}\"\n\n";
-content

ambari git commit: AMBARI-13793 Resource Manager (HA) fails to start after enabling Kerberos (dsen)

2015-11-09 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 fb0d3c49a -> 9b602463a


AMBARI-13793 Resource Manager (HA) fails to start after enabling Kerberos (dsen)


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

Branch: refs/heads/branch-2.1
Commit: 9b602463a76e1fb8e6c15479158ab5b129c07126
Parents: fb0d3c4
Author: Dmytro Sen 
Authored: Mon Nov 9 20:57:41 2015 +0200
Committer: Dmytro Sen 
Committed: Mon Nov 9 20:58:45 2015 +0200

--
 .../YARN/2.1.0.2.0/package/scripts/params_linux.py  |  3 ---
 .../YARN/2.1.0.2.0/package/scripts/yarn.py  | 12 
 .../python/stacks/2.0.6/YARN/test_resourcemanager.py|  6 --
 3 files changed, 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9b602463/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
index 2bfd8cc..0e9d77c 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
@@ -122,9 +122,6 @@ security_enabled = 
config['configurations']['cluster-env']['security_enabled']
 nm_security_marker = '/var/lib/hadoop-yarn/nm_security_enabled'
 current_nm_security_state = os.path.isfile(nm_security_marker)
 toggle_nm_security = (current_nm_security_state and not security_enabled) or 
(not current_nm_security_state and security_enabled)
-rm_security_marker = "/var/lib/hadoop-yarn/rm_security_enabled"
-current_rm_security_state = os.path.isfile(rm_security_marker)
-toggle_rm_security = (current_rm_security_state and not security_enabled) or 
(not current_rm_security_state and security_enabled)
 smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
 yarn_executor_container_group = 
config['configurations']['yarn-site']['yarn.nodemanager.linux-container-executor.group']
 yarn_nodemanager_container_executor_class =  
config['configurations']['yarn-site']['yarn.nodemanager.container-executor.class']

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b602463/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
index 4307e1d..8c52de2 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
@@ -229,18 +229,6 @@ def yarn(name = None):
mode=0700
   )
   params.HdfsResource(None, action="execute")
-if params.toggle_rm_security:
-  Execute('yarn resourcemanager -format-state-store', user = 
params.yarn_user,
-  )
-  # Setting RM marker file
-  if params.security_enabled:
-File(params.rm_security_marker,
- content="Marker file to track first start after 
enabling/disabling security. "
- "During first start ResourceManager state store is 
formatted"
-)
-  elif not params.security_enabled:
-File(params.rm_security_marker, action="delete")
-
 
 
   elif name == 'apptimelineserver':

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b602463/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py 
b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
index d00dc4b..4a4ca93 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
@@ -434,12 +434,6 @@ class TestResourceManager(RMFTestCase):
   owner = 'yarn',
   group = 'hadoop',
 )
-self.assertResourceCalled('Execute', 'yarn resourcemanager 
-format-state-store',
-  user = 'yarn',
-)
-self.assertResourceCalled('File', 
'/var/lib/hadoop-yarn/rm_security_enabled',
-  content = 'Marker file to track first start 
after enabling/di

ambari git commit: AMBARI-13793 Resource Manager (HA) fails to start after enabling Kerberos (dsen)

2015-11-09 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk 9c086c303 -> 4cccb8708


AMBARI-13793 Resource Manager (HA) fails to start after enabling Kerberos (dsen)


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

Branch: refs/heads/trunk
Commit: 4cccb8708a37de5a83ced70565ccdb1103fc30e6
Parents: 9c086c3
Author: Dmytro Sen 
Authored: Mon Nov 9 20:57:41 2015 +0200
Committer: Dmytro Sen 
Committed: Mon Nov 9 20:57:41 2015 +0200

--
 .../YARN/2.1.0.2.0/package/scripts/params_linux.py  |  3 ---
 .../YARN/2.1.0.2.0/package/scripts/yarn.py  | 12 
 .../python/stacks/2.0.6/YARN/test_resourcemanager.py|  6 --
 3 files changed, 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4cccb870/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
index a02a84d..f608b08 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
@@ -121,9 +121,6 @@ security_enabled = 
config['configurations']['cluster-env']['security_enabled']
 nm_security_marker = '/var/lib/hadoop-yarn/nm_security_enabled'
 current_nm_security_state = os.path.isfile(nm_security_marker)
 toggle_nm_security = (current_nm_security_state and not security_enabled) or 
(not current_nm_security_state and security_enabled)
-rm_security_marker = "/var/lib/hadoop-yarn/rm_security_enabled"
-current_rm_security_state = os.path.isfile(rm_security_marker)
-toggle_rm_security = (current_rm_security_state and not security_enabled) or 
(not current_rm_security_state and security_enabled)
 smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
 yarn_executor_container_group = 
config['configurations']['yarn-site']['yarn.nodemanager.linux-container-executor.group']
 yarn_nodemanager_container_executor_class =  
config['configurations']['yarn-site']['yarn.nodemanager.container-executor.class']

http://git-wip-us.apache.org/repos/asf/ambari/blob/4cccb870/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
index 4d5cb9b..451976f 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
@@ -230,18 +230,6 @@ def yarn(name = None):
mode=0700
   )
   params.HdfsResource(None, action="execute")
-if params.toggle_rm_security:
-  Execute('yarn resourcemanager -format-state-store', user = 
params.yarn_user,
-  )
-  # Setting RM marker file
-  if params.security_enabled:
-File(params.rm_security_marker,
- content="Marker file to track first start after 
enabling/disabling security. "
- "During first start ResourceManager state store is 
formatted"
-)
-  elif not params.security_enabled:
-File(params.rm_security_marker, action="delete")
-
 
 
   elif name == 'apptimelineserver':

http://git-wip-us.apache.org/repos/asf/ambari/blob/4cccb870/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py 
b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
index 4639bd4..80492b4 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
@@ -434,12 +434,6 @@ class TestResourceManager(RMFTestCase):
   owner = 'yarn',
   group = 'hadoop',
 )
-self.assertResourceCalled('Execute', 'yarn resourcemanager 
-format-state-store',
-  user = 'yarn',
-)
-self.assertResourceCalled('File', 
'/var/lib/hadoop-yarn/rm_security_enabled',
-  content = 'Marker file to track first start 
after enabling/disabling se

ambari git commit: AMBARI-13758 Zookeeper quorum hosts for AMS should point to localhost for distributed mode. (Aravindan Vijayan via dsen)

2015-11-09 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 a539f3509 -> fb0d3c49a


AMBARI-13758 Zookeeper quorum hosts for AMS should point to localhost for 
distributed mode. (Aravindan Vijayan via dsen)


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

Branch: refs/heads/branch-2.1
Commit: fb0d3c49a810488da3cfa13b3ad09e1aea10e70d
Parents: a539f35
Author: Dmytro Sen 
Authored: Mon Nov 9 20:47:40 2015 +0200
Committer: Dmytro Sen 
Committed: Mon Nov 9 20:49:23 2015 +0200

--
 .../internal/AbstractProviderModule.java| 38 +++-
 .../0.1.0/package/scripts/params.py |  2 +-
 2 files changed, 38 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fb0d3c49/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
index 3ac64e3..2ef0a8e 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
@@ -95,6 +95,7 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
   private static final String PROPERTY_HDFS_HTTP_POLICY_VALUE_HTTPS_ONLY = 
"HTTPS_ONLY";
 
   private static final String COLLECTOR_DEFAULT_PORT = "6188";
+  private static boolean vipHostConfigPresent = false;
 
   private static final Map> jmxDesiredProperties 
= new HashMap>();
   private volatile Map clusterHdfsSiteConfigVersionMap = new 
HashMap();
@@ -290,6 +291,7 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
   String currentConfigVersion = getDesiredConfigVersion(clusterName, 
configType);
   String oldConfigVersion = serviceConfigVersions.get(configType);
   if (!currentConfigVersion.equals(oldConfigVersion)) {
+vipHostConfigPresent = false;
 serviceConfigVersions.put(configType, currentConfigVersion);
 Map configProperties = getDesiredConfigMap
   (clusterName, currentConfigVersion, configType,
@@ -300,6 +302,7 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
   clusterMetricserverVipHost = 
configProperties.get("METRICS_COLLECTOR");
   if (clusterMetricserverVipHost != null) {
 clusterMetricCollectorMap.put(clusterName, 
clusterMetricserverVipHost);
+vipHostConfigPresent = true;
   }
 }
 // updating the port value, because both vip properties are stored in
@@ -316,6 +319,26 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
 } catch (NoSuchParentResourceException | UnsupportedPropertyException e) {
   LOG.warn("Failed to retrieve collector hostname.", e);
 }
+
+//If vip config not present
+//  If current collector host is null or if the host or the host component 
not live
+//Update clusterMetricCollectorMap with a live metric collector host.
+if (!vipHostConfigPresent) {
+  String currentCollectorHost = clusterMetricCollectorMap.get(clusterName);
+  if(! (isHostLive(clusterName, currentCollectorHost) &&
+isHostComponentLive(clusterName, currentCollectorHost, 
"AMBARI_METRICS", Role.METRICS_COLLECTOR.name())) ) {
+for (String hostname : metricServerHosts) {
+  if (isHostLive(clusterName, hostname)
+&& isHostComponentLive(clusterName, hostname, "AMBARI_METRICS", 
Role.METRICS_COLLECTOR.name())) {
+clusterMetricCollectorMap.put(clusterName, hostname);
+LOG.debug("New Metrics Collector Host : " + hostname);
+break;
+  } else {
+LOG.debug("Metrics Collector Host or host component not live : " + 
hostname);
+  }
+}
+  }
+}
 return clusterMetricCollectorMap.get(clusterName);
   }
 
@@ -767,7 +790,20 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
 clusterGangliaCollectorMap.put(clusterName, hostName);
   }
   if (componentName.equals(METRIC_SERVER)) {
-clusterMetricCollectorMap.put(clusterName, hostName);
+//If vip config not present
+//  If current collector host is null or if the host or the host 
component not live
+//Update clusterMetricCollectorMap.
+if (!vip

ambari git commit: AMBARI-13758 Zookeeper quorum hosts for AMS should point to localhost for distributed mode. (Aravindan Vijayan via dsen)

2015-11-09 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk e10d40208 -> 9c086c303


AMBARI-13758 Zookeeper quorum hosts for AMS should point to localhost for 
distributed mode. (Aravindan Vijayan via dsen)


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

Branch: refs/heads/trunk
Commit: 9c086c303fb6f772d2fb5d654b6bf7de2225ca62
Parents: e10d402
Author: Dmytro Sen 
Authored: Mon Nov 9 20:47:13 2015 +0200
Committer: Dmytro Sen 
Committed: Mon Nov 9 20:47:40 2015 +0200

--
 .../internal/AbstractProviderModule.java| 38 +++-
 .../0.1.0/package/scripts/params.py |  2 +-
 2 files changed, 38 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9c086c30/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
index 3ac64e3..2ef0a8e 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java
@@ -95,6 +95,7 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
   private static final String PROPERTY_HDFS_HTTP_POLICY_VALUE_HTTPS_ONLY = 
"HTTPS_ONLY";
 
   private static final String COLLECTOR_DEFAULT_PORT = "6188";
+  private static boolean vipHostConfigPresent = false;
 
   private static final Map> jmxDesiredProperties 
= new HashMap>();
   private volatile Map clusterHdfsSiteConfigVersionMap = new 
HashMap();
@@ -290,6 +291,7 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
   String currentConfigVersion = getDesiredConfigVersion(clusterName, 
configType);
   String oldConfigVersion = serviceConfigVersions.get(configType);
   if (!currentConfigVersion.equals(oldConfigVersion)) {
+vipHostConfigPresent = false;
 serviceConfigVersions.put(configType, currentConfigVersion);
 Map configProperties = getDesiredConfigMap
   (clusterName, currentConfigVersion, configType,
@@ -300,6 +302,7 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
   clusterMetricserverVipHost = 
configProperties.get("METRICS_COLLECTOR");
   if (clusterMetricserverVipHost != null) {
 clusterMetricCollectorMap.put(clusterName, 
clusterMetricserverVipHost);
+vipHostConfigPresent = true;
   }
 }
 // updating the port value, because both vip properties are stored in
@@ -316,6 +319,26 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
 } catch (NoSuchParentResourceException | UnsupportedPropertyException e) {
   LOG.warn("Failed to retrieve collector hostname.", e);
 }
+
+//If vip config not present
+//  If current collector host is null or if the host or the host component 
not live
+//Update clusterMetricCollectorMap with a live metric collector host.
+if (!vipHostConfigPresent) {
+  String currentCollectorHost = clusterMetricCollectorMap.get(clusterName);
+  if(! (isHostLive(clusterName, currentCollectorHost) &&
+isHostComponentLive(clusterName, currentCollectorHost, 
"AMBARI_METRICS", Role.METRICS_COLLECTOR.name())) ) {
+for (String hostname : metricServerHosts) {
+  if (isHostLive(clusterName, hostname)
+&& isHostComponentLive(clusterName, hostname, "AMBARI_METRICS", 
Role.METRICS_COLLECTOR.name())) {
+clusterMetricCollectorMap.put(clusterName, hostname);
+LOG.debug("New Metrics Collector Host : " + hostname);
+break;
+  } else {
+LOG.debug("Metrics Collector Host or host component not live : " + 
hostname);
+  }
+}
+  }
+}
 return clusterMetricCollectorMap.get(clusterName);
   }
 
@@ -767,7 +790,20 @@ public abstract class AbstractProviderModule implements 
ProviderModule,
 clusterGangliaCollectorMap.put(clusterName, hostName);
   }
   if (componentName.equals(METRIC_SERVER)) {
-clusterMetricCollectorMap.put(clusterName, hostName);
+//If vip config not present
+//  If current collector host is null or if the host or the host 
component not live
+//Update clusterMetricCollectorMap.
+if (!vipHostConfig

ambari git commit: AMBARI-13799 Label in Express Upgrade Window shows "Downgrade" while doing upgrade after downgrade. (atkach)

2015-11-09 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/trunk 8997ce0d5 -> e10d40208


AMBARI-13799 Label in Express Upgrade Window shows "Downgrade" while doing 
upgrade after downgrade. (atkach)


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

Branch: refs/heads/trunk
Commit: e10d40208a4188ef44866633a8c0c492feb492d3
Parents: 8997ce0
Author: Andrii Tkach 
Authored: Mon Nov 9 20:44:07 2015 +0200
Committer: Andrii Tkach 
Committed: Mon Nov 9 20:44:35 2015 +0200

--
 .../global/background_operations_controller.js  |  6 +++-
 .../controllers/global/cluster_controller.js|  2 ++
 .../main/admin/stack_and_upgrade_controller.js  |  2 +-
 ambari-web/app/utils/ajax/ajax.js   |  2 +-
 .../admin/stack_and_upgrade_controller_test.js  | 38 ++--
 5 files changed, 36 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e10d4020/ambari-web/app/controllers/global/background_operations_controller.js
--
diff --git 
a/ambari-web/app/controllers/global/background_operations_controller.js 
b/ambari-web/app/controllers/global/background_operations_controller.js
index b78a35b..bc05284 100644
--- a/ambari-web/app/controllers/global/background_operations_controller.js
+++ b/ambari-web/app/controllers/global/background_operations_controller.js
@@ -207,11 +207,12 @@ App.BackgroundOperationsController = 
Em.Controller.extend({
 var currentRequestIds = [];
 var countIssued = this.get('operationsCount');
 var countGot = data.itemTotal;
+var restoreUpgradeState = false;
 
 data.items.forEach(function (request) {
   if (this.isUpgradeRequest(request)) {
 if (!App.get('upgradeIsRunning') && !App.get('testMode')) {
-  App.router.get('clusterController').restoreUpgradeState();
+  restoreUpgradeState = true;
 }
 return;
   }
@@ -252,6 +253,9 @@ App.BackgroundOperationsController = Em.Controller.extend({
   }
   runningServices += ~~isRunning;
 }, this);
+if (restoreUpgradeState) {
+  App.router.get('clusterController').restoreUpgradeState();
+}
 this.removeOldRequests(currentRequestIds);
 this.set("allOperationsCount", runningServices);
 this.set('isShowMoreAvailable', countGot >= countIssued);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e10d4020/ambari-web/app/controllers/global/cluster_controller.js
--
diff --git a/ambari-web/app/controllers/global/cluster_controller.js 
b/ambari-web/app/controllers/global/cluster_controller.js
index 4f2ee38..d36811e 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -295,6 +295,7 @@ App.ClusterController = 
Em.Controller.extend(App.ReloadPopupMixin, {
   var upgradeController = 
App.router.get('mainAdminStackAndUpgradeController');
   var lastUpgradeData = 
data.items.sortProperty('Upgrade.request_id').pop();
   var dbUpgradeState = App.db.get('MainAdminStackAndUpgrade', 
'upgradeState');
+  var fromVersion = 
App.RepositoryVersion.find().findProperty('repositoryVersion', 
lastUpgradeData.Upgrade.from_version);
 
   if (!Em.isNone(dbUpgradeState)) {
 App.set('upgradeState', dbUpgradeState);
@@ -307,6 +308,7 @@ App.ClusterController = 
Em.Controller.extend(App.ReloadPopupMixin, {
   upgradeState: lastUpgradeData.Upgrade.request_status,
   upgradeType: lastUpgradeData.Upgrade.upgrade_type,
   downgradeAllowed: lastUpgradeData.Upgrade.downgrade_allowed,
+  upgradeTypeDisplayName: fromVersion && 
fromVersion.get('displayName'),
   failuresTolerance: Em.Object.create({
 skipComponentFailures: lastUpgradeData.Upgrade.skip_failures,
 skipSCFailures: lastUpgradeData.Upgrade.skip_service_check_failures

http://git-wip-us.apache.org/repos/asf/ambari/blob/e10d4020/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js 
b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
index 1e23b66..27965dd 100644
--- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
@@ -235,7 +235,7 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
   initDBProperties: function () {
 var props = this.getDBPro

ambari git commit: AMBARI-13799 Label in Express Upgrade Window shows "Downgrade" while doing upgrade after downgrade. (atkach)

2015-11-09 Thread atkach
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 486a40672 -> a539f3509


AMBARI-13799 Label in Express Upgrade Window shows "Downgrade" while doing 
upgrade after downgrade. (atkach)


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

Branch: refs/heads/branch-2.1
Commit: a539f35091c5173311de5ada4b4487819f6a23a5
Parents: 486a406
Author: Andrii Tkach 
Authored: Mon Nov 9 20:08:42 2015 +0200
Committer: Andrii Tkach 
Committed: Mon Nov 9 20:08:42 2015 +0200

--
 .../global/background_operations_controller.js  |  6 +++-
 .../controllers/global/cluster_controller.js|  2 ++
 .../main/admin/stack_and_upgrade_controller.js  |  2 +-
 ambari-web/app/utils/ajax/ajax.js   |  2 +-
 .../admin/stack_and_upgrade_controller_test.js  | 38 ++--
 5 files changed, 36 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a539f350/ambari-web/app/controllers/global/background_operations_controller.js
--
diff --git 
a/ambari-web/app/controllers/global/background_operations_controller.js 
b/ambari-web/app/controllers/global/background_operations_controller.js
index b78a35b..bc05284 100644
--- a/ambari-web/app/controllers/global/background_operations_controller.js
+++ b/ambari-web/app/controllers/global/background_operations_controller.js
@@ -207,11 +207,12 @@ App.BackgroundOperationsController = 
Em.Controller.extend({
 var currentRequestIds = [];
 var countIssued = this.get('operationsCount');
 var countGot = data.itemTotal;
+var restoreUpgradeState = false;
 
 data.items.forEach(function (request) {
   if (this.isUpgradeRequest(request)) {
 if (!App.get('upgradeIsRunning') && !App.get('testMode')) {
-  App.router.get('clusterController').restoreUpgradeState();
+  restoreUpgradeState = true;
 }
 return;
   }
@@ -252,6 +253,9 @@ App.BackgroundOperationsController = Em.Controller.extend({
   }
   runningServices += ~~isRunning;
 }, this);
+if (restoreUpgradeState) {
+  App.router.get('clusterController').restoreUpgradeState();
+}
 this.removeOldRequests(currentRequestIds);
 this.set("allOperationsCount", runningServices);
 this.set('isShowMoreAvailable', countGot >= countIssued);

http://git-wip-us.apache.org/repos/asf/ambari/blob/a539f350/ambari-web/app/controllers/global/cluster_controller.js
--
diff --git a/ambari-web/app/controllers/global/cluster_controller.js 
b/ambari-web/app/controllers/global/cluster_controller.js
index 9422729..37e45a4 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -286,6 +286,7 @@ App.ClusterController = Em.Controller.extend({
   var upgradeController = 
App.router.get('mainAdminStackAndUpgradeController');
   var lastUpgradeData = 
data.items.sortProperty('Upgrade.request_id').pop();
   var dbUpgradeState = App.db.get('MainAdminStackAndUpgrade', 
'upgradeState');
+  var fromVersion = 
App.RepositoryVersion.find().findProperty('repositoryVersion', 
lastUpgradeData.Upgrade.from_version);
 
   if (!Em.isNone(dbUpgradeState)) {
 App.set('upgradeState', dbUpgradeState);
@@ -298,6 +299,7 @@ App.ClusterController = Em.Controller.extend({
   upgradeState: lastUpgradeData.Upgrade.request_status,
   upgradeType: lastUpgradeData.Upgrade.upgrade_type,
   downgradeAllowed: lastUpgradeData.Upgrade.downgrade_allowed,
+  upgradeTypeDisplayName: fromVersion && 
fromVersion.get('displayName'),
   failuresTolerance: Em.Object.create({
 skipComponentFailures: lastUpgradeData.Upgrade.skip_failures,
 skipSCFailures: lastUpgradeData.Upgrade.skip_service_check_failures

http://git-wip-us.apache.org/repos/asf/ambari/blob/a539f350/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js 
b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
index 79b3432..9133125 100644
--- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
@@ -241,7 +241,7 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
   initDBProperties: function () {
 var props = this.getDBProperties(this.get('wizardStoragePrope

[1/2] ambari git commit: AMBARI-13342. Allow access to callers with valid Knox authorization cookie. (mpapirkovskyy)

2015-11-09 Thread mpapirkovskyy
Repository: ambari
Updated Branches:
  refs/heads/trunk edefa4858 -> 8997ce0d5


http://git-wip-us.apache.org/repos/asf/ambari/blob/8997ce0d/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilterTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilterTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilterTest.java
new file mode 100644
index 000..ae47694
--- /dev/null
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/security/authorization/jwt/JwtAuthenticationFilterTest.java
@@ -0,0 +1,244 @@
+/*
+ * 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.security.authorization.jwt;
+
+import com.nimbusds.jose.JOSEException;
+import com.nimbusds.jose.JWSAlgorithm;
+import com.nimbusds.jose.JWSHeader;
+import com.nimbusds.jose.crypto.RSASSASigner;
+import com.nimbusds.jwt.JWTClaimsSet;
+import com.nimbusds.jwt.SignedJWT;
+import org.apache.ambari.server.security.authorization.AmbariGrantedAuthority;
+import org.apache.ambari.server.security.authorization.User;
+import org.apache.ambari.server.security.authorization.UserType;
+import org.apache.ambari.server.security.authorization.Users;
+import org.easymock.EasyMock;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.context.SecurityContextHolder;
+import org.springframework.security.web.AuthenticationEntryPoint;
+
+import javax.servlet.FilterChain;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.interfaces.RSAPrivateKey;
+import java.security.interfaces.RSAPublicKey;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Date;
+
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.createMockBuilder;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.*;
+
+public class JwtAuthenticationFilterTest {
+  private static RSAPublicKey publicKey;
+  private static RSAPrivateKey privateKey;
+  private static RSAPrivateKey invalidPrivateKey;
+
+
+  @BeforeClass
+  public static void generateKeyPair() throws NoSuchAlgorithmException {
+KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
+keyPairGenerator.initialize(512);
+KeyPair keyPair = keyPairGenerator.generateKeyPair();
+publicKey = (RSAPublicKey) keyPair.getPublic();
+privateKey = (RSAPrivateKey) keyPair.getPrivate();
+
+keyPair = keyPairGenerator.generateKeyPair();
+invalidPrivateKey = (RSAPrivateKey) keyPair.getPrivate();
+  }
+
+  private JwtAuthenticationProperties createTestProperties() {
+JwtAuthenticationProperties properties = new JwtAuthenticationProperties();
+properties.setCookieName("non-default");
+properties.setPublicKey(publicKey);
+properties.setAudiences(Collections.singletonList("test-audience"));
+
+return properties;
+  }
+
+  private SignedJWT getSignedToken() throws JOSEException {
+RSASSASigner signer = new RSASSASigner(privateKey);
+
+Calendar calendar = Calendar.getInstance();
+calendar.setTimeInMillis(System.currentTimeMillis());
+
+JWTClaimsSet claimsSet = new JWTClaimsSet();
+claimsSet.setSubject("test-user");
+claimsSet.setIssuer("unit-test");
+claimsSet.setIssueTime(calendar.getTime());
+
+calendar.add(Calendar.DATE, 1); //add one day
+claimsSet.setExpirationTime(calendar.getTime());
+
+claimsSet.setAudience("test-a

[2/2] ambari git commit: AMBARI-13342. Allow access to callers with valid Knox authorization cookie. (mpapirkovskyy)

2015-11-09 Thread mpapirkovskyy
AMBARI-13342. Allow access to callers with valid Knox authorization cookie. 
(mpapirkovskyy)


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

Branch: refs/heads/trunk
Commit: 8997ce0d50d91c4cb008d303a07dfd7a949d1788
Parents: edefa48
Author: Myroslav Papirkovskyy 
Authored: Mon Nov 9 20:09:12 2015 +0200
Committer: Myroslav Papirkovskyy 
Committed: Mon Nov 9 20:09:12 2015 +0200

--
 ambari-server/pom.xml   |  12 +
 .../ambari/server/api/AmbariErrorHandler.java   |  13 +-
 .../server/configuration/Configuration.java |  53 +++
 .../AmbariManagementControllerImpl.java |   6 +-
 .../ambari/server/controller/AmbariServer.java  |   3 +
 .../ambari/server/controller/UserResponse.java  |  24 +-
 .../internal/UserPrivilegeResourceProvider.java |   4 +
 .../internal/UserResourceProvider.java  |   4 +
 .../apache/ambari/server/orm/dao/UserDAO.java   |  14 +
 .../ambari/server/orm/entities/UserEntity.java  |  31 +-
 .../AmbariAuthorizationFilter.java  |   8 +-
 .../server/security/authorization/User.java |  11 +-
 .../server/security/authorization/UserType.java |  24 ++
 .../server/security/authorization/Users.java|  82 -
 .../authorization/jwt/JwtAuthentication.java|  78 +
 .../jwt/JwtAuthenticationFilter.java| 329 +++
 .../jwt/JwtAuthenticationProperties.java|  85 +
 .../security/encryption/CertificateUtils.java   |  51 +++
 .../server/upgrade/UpgradeCatalog220.java   |  12 +
 ambari-server/src/main/python/ambari-server.py  |   8 +-
 .../main/python/ambari_server/setupActions.py   |   3 +-
 .../src/main/python/ambari_server/setupSso.py   | 121 +++
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |   3 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |   3 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql|   5 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql |   5 +-
 .../resources/Ambari-DDL-SQLAnywhere-CREATE.sql |   3 +-
 .../resources/Ambari-DDL-SQLServer-CREATE.sql   |   9 +-
 .../src/main/resources/properties.json  |   1 +
 .../webapp/WEB-INF/spring-security.xml  |   5 +-
 .../server/api/AmbariErrorHandlerTest.java  |   4 +-
 .../jwt/JwtAuthenticationFilterTest.java| 244 ++
 32 files changed, 1214 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8997ce0d/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 5a7ddc4..ebe5cc2 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -2011,6 +2011,18 @@
   ehcache
   2.10.0
 
+
+  com.nimbusds
+  nimbus-jose-jwt
+  3.9
+  compile
+  
+
+  org.bouncycastle
+  bcprov-jdk15on
+
+  
+
   
 
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/8997ce0d/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariErrorHandler.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariErrorHandler.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariErrorHandler.java
index ee4e56f..d526ac7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariErrorHandler.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariErrorHandler.java
@@ -21,6 +21,8 @@ package org.apache.ambari.server.api;
 import com.google.gson.Gson;
 import com.google.inject.Inject;
 import com.google.inject.name.Named;
+import org.apache.ambari.server.configuration.Configuration;
+import 
org.apache.ambari.server.security.authorization.jwt.JwtAuthenticationProperties;
 import org.eclipse.jetty.http.HttpStatus;
 import org.eclipse.jetty.http.MimeTypes;
 import org.eclipse.jetty.server.AbstractHttpConnection;
@@ -35,10 +37,12 @@ import java.util.Map;
 
 public class AmbariErrorHandler extends ErrorHandler {
   private final Gson gson;
+  private Configuration configuration;
 
   @Inject
-  public AmbariErrorHandler(@Named("prettyGson") Gson prettyGson) {
+  public AmbariErrorHandler(@Named("prettyGson") Gson prettyGson, 
Configuration configuration) {
 this.gson = prettyGson;
+this.configuration = configuration;
   }
 
   @Override
@@ -57,6 +61,13 @@ public class AmbariErrorHandler extends ErrorHandler {
 }
 errorMap.put("message", message);
 
+if (code == HttpServletResponse.SC_FORBIDDEN) {
+  JwtAuthenticationProperties jwtProperties = 
configuration.getJwtProperties();
+  if (jwtProperti

[1/2] ambari git commit: AMBARI-13792. Difference in configuration downloaded from UI and actual configuration files for Hive (dlysnichenko)

2015-11-09 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 29bac55b6 -> 486a40672
  refs/heads/trunk a20d8f73c -> edefa4858


AMBARI-13792. Difference in configuration downloaded from UI and actual 
configuration files for Hive (dlysnichenko)


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

Branch: refs/heads/branch-2.1
Commit: 486a406723e26f917dce6cd17eddd091267dfc4d
Parents: 29bac55
Author: Lisnichenko Dmitro 
Authored: Mon Nov 9 19:34:14 2015 +0200
Committer: Lisnichenko Dmitro 
Committed: Mon Nov 9 19:34:14 2015 +0200

--
 .../ambari/server/actionmanager/ActionScheduler.java |  4 +++-
 .../controller/AmbariManagementControllerImpl.java   |  4 +++-
 .../internal/ClientConfigResourceProvider.java   | 15 +++
 3 files changed, 21 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/486a4067/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
index 982bb15..3b489e5 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
@@ -328,7 +328,9 @@ class ActionScheduler implements Runnable {
 for (ExecutionCommand cmd : commandsToSchedule) {
 
   // Hack - Remove passwords from configs
-  if (cmd.getRole().equals(Role.HIVE_CLIENT.toString()) &&
+  if ((cmd.getRole().equals(Role.HIVE_CLIENT.toString()) ||
+  cmd.getRole().equals(Role.WEBHCAT_SERVER.toString()) ||
+  cmd.getRole().equals(Role.HCAT.toString())) &&
   
cmd.getConfigurations().containsKey(Configuration.HIVE_CONFIG_TAG)) {
 
cmd.getConfigurations().get(Configuration.HIVE_CONFIG_TAG).remove(Configuration.HIVE_METASTORE_PASSWORD_PROPERTY);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/486a4067/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 1d922e2..c24b269 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -2548,7 +2548,9 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 StageUtils.getClusterHostInfo(cluster));
 
 // Hack - Remove passwords from configs
-if (ec.getRole().equals(Role.HIVE_CLIENT.toString()) &&
+if ((ec.getRole().equals(Role.HIVE_CLIENT.toString()) ||
+ec.getRole().equals(Role.WEBHCAT_SERVER.toString()) ||
+ec.getRole().equals(Role.HCAT.toString())) &&
 ec.getConfigurations().containsKey(Configuration.HIVE_CONFIG_TAG)) {
   
ec.getConfigurations().get(Configuration.HIVE_CONFIG_TAG).remove(Configuration.HIVE_METASTORE_PASSWORD_PROPERTY);
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/486a4067/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 dea0362..43aba04 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
@@ -46,10 +46,12 @@ import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.Config;
 import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.DesiredConfig;
+import org.apache.ambari.server.state.PropertyInfo;
 import org.apache.ambari.server.state.PropertyInfo.PropertyType;
 import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.state.ServiceOsSpecific

[2/2] ambari git commit: AMBARI-13792. Difference in configuration downloaded from UI and actual configuration files for Hive (dlysnichenko)

2015-11-09 Thread dmitriusan
AMBARI-13792. Difference in configuration downloaded from UI and actual 
configuration files for Hive (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: edefa4858ff95d82e742dbb86d2c48bbd34af2c2
Parents: a20d8f7
Author: Lisnichenko Dmitro 
Authored: Mon Nov 9 19:34:14 2015 +0200
Committer: Lisnichenko Dmitro 
Committed: Mon Nov 9 19:35:53 2015 +0200

--
 .../ambari/server/actionmanager/ActionScheduler.java |  4 +++-
 .../controller/AmbariManagementControllerImpl.java   |  4 +++-
 .../internal/ClientConfigResourceProvider.java   | 15 +++
 3 files changed, 21 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/edefa485/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
index effd869..5415264 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
@@ -329,7 +329,9 @@ class ActionScheduler implements Runnable {
 for (ExecutionCommand cmd : commandsToSchedule) {
 
   // Hack - Remove passwords from configs
-  if (cmd.getRole().equals(Role.HIVE_CLIENT.toString()) &&
+  if ((cmd.getRole().equals(Role.HIVE_CLIENT.toString()) ||
+  cmd.getRole().equals(Role.WEBHCAT_SERVER.toString()) ||
+  cmd.getRole().equals(Role.HCAT.toString())) &&
   
cmd.getConfigurations().containsKey(Configuration.HIVE_CONFIG_TAG)) {
 
cmd.getConfigurations().get(Configuration.HIVE_CONFIG_TAG).remove(Configuration.HIVE_METASTORE_PASSWORD_PROPERTY);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edefa485/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 6a1e85c..49a8d8b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -2558,7 +2558,9 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 StageUtils.getClusterHostInfo(cluster));
 
 // Hack - Remove passwords from configs
-if (ec.getRole().equals(Role.HIVE_CLIENT.toString()) &&
+if ((ec.getRole().equals(Role.HIVE_CLIENT.toString()) ||
+ec.getRole().equals(Role.WEBHCAT_SERVER.toString()) ||
+ec.getRole().equals(Role.HCAT.toString())) &&
 ec.getConfigurations().containsKey(Configuration.HIVE_CONFIG_TAG)) {
   
ec.getConfigurations().get(Configuration.HIVE_CONFIG_TAG).remove(Configuration.HIVE_METASTORE_PASSWORD_PROPERTY);
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/edefa485/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 dea0362..43aba04 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
@@ -46,10 +46,12 @@ import org.apache.ambari.server.state.ComponentInfo;
 import org.apache.ambari.server.state.Config;
 import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.DesiredConfig;
+import org.apache.ambari.server.state.PropertyInfo;
 import org.apache.ambari.server.state.PropertyInfo.PropertyType;
 import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.state.ServiceOsSpecific;
 import org.apache.ambari.server.state.StackId;
+import org.apache.ambari.server.utils.SecretReference;
 import org.apache.ambari.s

ambari git commit: AMBARI-13796. SERVICE_CHECK HIVE is Failed (Critical Alert is present).(vbrodetskyi)

2015-11-09 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/trunk d7f6f18e5 -> a20d8f73c


AMBARI-13796. SERVICE_CHECK HIVE is Failed (Critical Alert is 
present).(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: a20d8f73c37984ffd743100c7ef6faa865da73fb
Parents: d7f6f18
Author: Vitaly Brodetskyi 
Authored: Mon Nov 9 19:25:17 2015 +0200
Committer: Vitaly Brodetskyi 
Committed: Mon Nov 9 19:25:17 2015 +0200

--
 .../0.12.0.2.0/package/scripts/hive_service.py  |  9 +++---
 .../stacks/2.0.6/HIVE/test_hive_metastore.py| 25 ---
 .../stacks/2.0.6/HIVE/test_hive_server.py   | 33 ++--
 .../stacks/2.1/HIVE/test_hive_metastore.py  | 27 
 4 files changed, 49 insertions(+), 45 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a20d8f73/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
index cda869e..5f11715 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
@@ -30,6 +30,7 @@ from resource_management.core.resources.service import Service
 from resource_management.core.exceptions import Fail
 from resource_management.core.shell import as_user
 from resource_management.libraries.functions.hive_check import 
check_thrift_port_sasl
+from resource_management.libraries.functions import get_user_call_output
 
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 from ambari_commons import OSConst
@@ -64,8 +65,8 @@ def hive_service(name, action='start', upgrade_type=None):
   hive_kinit_cmd = format("{kinit_path_local} -kt {hive_server2_keytab} 
{hive_principal}; ")
   Execute(hive_kinit_cmd, user=params.hive_user)
 
-  pid_expression = "`" + as_user(format("cat {pid_file}"), 
user=params.hive_user) + "`"
-  process_id_exists_command = format("ls {pid_file} >/dev/null 2>&1 && ps -p 
{pid_expression} >/dev/null 2>&1")
+  pid = get_user_call_output.get_user_call_output(format("cat {pid_file}"), 
user=params.hive_user, is_checked_call=False)[1]
+  process_id_exists_command = format("ls {pid_file} >/dev/null 2>&1 && ps -p 
{pid} >/dev/null 2>&1")
 
   if action == 'start':
 if name == 'hiveserver2':
@@ -103,8 +104,8 @@ def hive_service(name, action='start', upgrade_type=None):
   path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin', tries=5, 
try_sleep=10)
   elif action == 'stop':
 
-daemon_kill_cmd = format("{sudo} kill {pid_expression}")
-daemon_hard_kill_cmd = format("{sudo} kill -9 {pid_expression}")
+daemon_kill_cmd = format("{sudo} kill {pid}")
+daemon_hard_kill_cmd = format("{sudo} kill -9 {pid}")
 
 Execute(daemon_kill_cmd,
   not_if = format("! ({process_id_exists_command})")

http://git-wip-us.apache.org/repos/asf/ambari/blob/a20d8f73/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py 
b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
index 517d71c..5df0fb8 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
@@ -22,6 +22,7 @@ import os
 from mock.mock import MagicMock, call, patch
 from stacks.utils.RMFTestCase import *
 
+@patch("resource_management.libraries.functions.get_user_call_output.get_user_call_output",
 new=MagicMock(return_value=(0,'123','')))
 class TestHiveMetastore(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "HIVE/0.12.0.2.0/package"
   STACK_VERSION = "2.0.6"
@@ -50,7 +51,7 @@ class TestHiveMetastore(RMFTestCase):
 environment = {'HADOOP_HOME': '/usr',
'HIVE_BIN': 'hive',
'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'},
-not_if = "ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p 
`ambari-sudo.sh su hive -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]cat 
/var/run/hive/hive.pid'` >/dev/null 2>&1",
+not_if = "ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p 123 
>/dev/null 2>&1",
 user = 'hive',
 path = ['/bin:/usr/lib/hive/bin:/usr/bin'],
  

ambari git commit: AMBARI-13796. SERVICE_CHECK HIVE is Failed (Critical Alert is present).(vbrodetskyi)

2015-11-09 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 0936c4357 -> 29bac55b6


AMBARI-13796. SERVICE_CHECK HIVE is Failed (Critical Alert is 
present).(vbrodetskyi)


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

Branch: refs/heads/branch-2.1
Commit: 29bac55b68d8fe720638fcdfbb399dd0f6af7d05
Parents: 0936c43
Author: Vitaly Brodetskyi 
Authored: Mon Nov 9 19:22:57 2015 +0200
Committer: Vitaly Brodetskyi 
Committed: Mon Nov 9 19:24:03 2015 +0200

--
 .../0.12.0.2.0/package/scripts/hive_service.py  |  9 +++---
 .../stacks/2.0.6/HIVE/test_hive_metastore.py| 25 ---
 .../stacks/2.0.6/HIVE/test_hive_server.py   | 33 ++--
 .../stacks/2.1/HIVE/test_hive_metastore.py  | 27 
 4 files changed, 49 insertions(+), 45 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/29bac55b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
index cda869e..5f11715 100644
--- 
a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
+++ 
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
@@ -30,6 +30,7 @@ from resource_management.core.resources.service import Service
 from resource_management.core.exceptions import Fail
 from resource_management.core.shell import as_user
 from resource_management.libraries.functions.hive_check import 
check_thrift_port_sasl
+from resource_management.libraries.functions import get_user_call_output
 
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
 from ambari_commons import OSConst
@@ -64,8 +65,8 @@ def hive_service(name, action='start', upgrade_type=None):
   hive_kinit_cmd = format("{kinit_path_local} -kt {hive_server2_keytab} 
{hive_principal}; ")
   Execute(hive_kinit_cmd, user=params.hive_user)
 
-  pid_expression = "`" + as_user(format("cat {pid_file}"), 
user=params.hive_user) + "`"
-  process_id_exists_command = format("ls {pid_file} >/dev/null 2>&1 && ps -p 
{pid_expression} >/dev/null 2>&1")
+  pid = get_user_call_output.get_user_call_output(format("cat {pid_file}"), 
user=params.hive_user, is_checked_call=False)[1]
+  process_id_exists_command = format("ls {pid_file} >/dev/null 2>&1 && ps -p 
{pid} >/dev/null 2>&1")
 
   if action == 'start':
 if name == 'hiveserver2':
@@ -103,8 +104,8 @@ def hive_service(name, action='start', upgrade_type=None):
   path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin', tries=5, 
try_sleep=10)
   elif action == 'stop':
 
-daemon_kill_cmd = format("{sudo} kill {pid_expression}")
-daemon_hard_kill_cmd = format("{sudo} kill -9 {pid_expression}")
+daemon_kill_cmd = format("{sudo} kill {pid}")
+daemon_hard_kill_cmd = format("{sudo} kill -9 {pid}")
 
 Execute(daemon_kill_cmd,
   not_if = format("! ({process_id_exists_command})")

http://git-wip-us.apache.org/repos/asf/ambari/blob/29bac55b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py 
b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
index 517d71c..5df0fb8 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py
@@ -22,6 +22,7 @@ import os
 from mock.mock import MagicMock, call, patch
 from stacks.utils.RMFTestCase import *
 
+@patch("resource_management.libraries.functions.get_user_call_output.get_user_call_output",
 new=MagicMock(return_value=(0,'123','')))
 class TestHiveMetastore(RMFTestCase):
   COMMON_SERVICES_PACKAGE_DIR = "HIVE/0.12.0.2.0/package"
   STACK_VERSION = "2.0.6"
@@ -50,7 +51,7 @@ class TestHiveMetastore(RMFTestCase):
 environment = {'HADOOP_HOME': '/usr',
'HIVE_BIN': 'hive',
'JAVA_HOME': u'/usr/jdk64/jdk1.7.0_45'},
-not_if = "ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p 
`ambari-sudo.sh su hive -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]cat 
/var/run/hive/hive.pid'` >/dev/null 2>&1",
+not_if = "ls /var/run/hive/hive.pid >/dev/null 2>&1 && ps -p 123 
>/dev/null 2>&1",
 user = 'hive',
 path = ['/bin:/usr/lib/hive/bin:/usr

[2/2] ambari git commit: AMBARI-13785. JS errors on leaving pages with graphs before they're loaded

2015-11-09 Thread alexantonenko
AMBARI-13785. JS errors on leaving pages with graphs before they're loaded


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

Branch: refs/heads/trunk
Commit: ac8147b6c9786da067b068ded9c87865ba711547
Parents: 47ab142
Author: Alex Antonenko 
Authored: Mon Nov 9 15:28:30 2015 +0200
Committer: Alex Antonenko 
Committed: Mon Nov 9 19:06:19 2015 +0200

--
 ambari-web/app/assets/test/tests.js |  1 +
 ambari-web/app/utils/ember_reopen.js| 12 +++
 .../app/views/common/chart/linear_time.js   | 15 ++--
 ambari-web/test/utils/ember_reopen_test.js  | 81 
 4 files changed, 103 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ac8147b6/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 71c69db..7e3c83d 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -169,6 +169,7 @@ var files = [
   'test/utils/data_manipulation_test',
   'test/utils/config_test',
   'test/utils/db_test',
+  'test/utils/ember_reopen_test',
   'test/utils/form_field_test',
   'test/utils/host_progress_popup_test',
   'test/utils/misc_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac8147b6/ambari-web/app/utils/ember_reopen.js
--
diff --git a/ambari-web/app/utils/ember_reopen.js 
b/ambari-web/app/utils/ember_reopen.js
index b1bcdcf..4f3f1dd 100644
--- a/ambari-web/app/utils/ember_reopen.js
+++ b/ambari-web/app/utils/ember_reopen.js
@@ -199,6 +199,18 @@ Em.View.reopen({
 } else {
   console.debug('Calling set on destroyed view');
 }
+  },
+
+  /**
+   * overwritten setProperties method of Ember.View to avoid uncaught errors
+   * when trying to set multiple properties of destroyed view
+   */
+  setProperties: function(hash){
+if(!this.get('isDestroyed') && !this.get('isDestroying')){
+  this._super(hash);
+} else {
+  console.debug('Calling setProperties on destroyed view');
+}
   }
 });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac8147b6/ambari-web/app/views/common/chart/linear_time.js
--
diff --git a/ambari-web/app/views/common/chart/linear_time.js 
b/ambari-web/app/views/common/chart/linear_time.js
index a6bd9a4..efea946 100644
--- a/ambari-web/app/views/common/chart/linear_time.js
+++ b/ambari-web/app/views/common/chart/linear_time.js
@@ -299,12 +299,15 @@ App.ChartLinearTimeView = 
Ember.View.extend(App.ExportMetricsMixin, {
   setExportTooltip: function () {
 if (this.get('isReady')) {
   Em.run.next(this, function () {
-this.$('.corner-icon').on('mouseover', function () {
-  $(this).closest("[rel='ZoomInTooltip']").trigger('mouseleave');
-});
-App.tooltip(this.$('.corner-icon > .icon-save'), {
-  title: Em.I18n.t('common.export')
-});
+var icon = this.$('.corner-icon');
+if (icon) {
+  icon.on('mouseover', function () {
+$(this).closest("[rel='ZoomInTooltip']").trigger('mouseleave');
+  });
+  App.tooltip(icon.children('.icon-save'), {
+title: Em.I18n.t('common.export')
+  });
+}
   });
 }
   }.observes('isReady'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac8147b6/ambari-web/test/utils/ember_reopen_test.js
--
diff --git a/ambari-web/test/utils/ember_reopen_test.js 
b/ambari-web/test/utils/ember_reopen_test.js
new file mode 100644
index 000..eda5e81
--- /dev/null
+++ b/ambari-web/test/utils/ember_reopen_test.js
@@ -0,0 +1,81 @@
+/**
+ * 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 

[2/2] ambari git commit: AMBARI-13790. "Username" and "Password" inputs are inactive after Sign Out during deploy

2015-11-09 Thread alexantonenko
AMBARI-13790. "Username" and "Password" inputs are inactive after Sign Out 
during deploy


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

Branch: refs/heads/branch-2.1
Commit: 0936c4357a48074f281634bd3425738877ede497
Parents: 84fc9cd
Author: Alex Antonenko 
Authored: Mon Nov 9 19:14:54 2015 +0200
Committer: Alex Antonenko 
Committed: Mon Nov 9 19:14:54 2015 +0200

--
 ambari-web/app/router.js | 19 +--
 1 file changed, 1 insertion(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0936c435/ambari-web/app/router.js
--
diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js
index f3bcbfe..15b4c14 100644
--- a/ambari-web/app/router.js
+++ b/ambari-web/app/router.js
@@ -112,13 +112,10 @@ App.Router = Em.Router.extend({
* @param wizardType one of installer, addHost, 
addServices
*/
   getWizardCurrentStep: function (wizardType) {
-var loginName = this.getLoginName();
 var currentStep = App.db.getWizardCurrentStep(wizardType);
-console.log('getWizardCurrentStep: loginName=' + loginName + ", 
currentStep=" + currentStep);
 if (!currentStep) {
   currentStep = wizardType === 'installer' ? '0' : '1';
 }
-console.log('returning currentStep=' + currentStep);
 return currentStep;
   },
 
@@ -192,12 +189,10 @@ App.Router = Em.Router.extend({
 if (data.status === 403) {
   this.setAuthenticated(false);
 } else {
-  console.log('error in getAuthenticated');
 }
   },
 
   setAuthenticated: function (authenticated) {
-console.log("TRACE: Entering router:setAuthenticated function");
 App.db.setAuthenticated(authenticated);
 this.set('loggedIn', authenticated);
   },
@@ -276,7 +271,7 @@ App.Router = Em.Router.extend({
   },
 
   loginSuccessCallback: function(data, opt, params) {
-console.log('login success');
+App.router.set('loginController.isSubmitDisabled', false);
 App.usersMapper.map({"items": [data]});
 this.setUserLoggedIn(decodeURIComponent(params.loginName));
 var requestData = {
@@ -299,7 +294,6 @@ App.Router = Em.Router.extend({
 
   loginErrorCallback: function(request, ajaxOptions, error, opt) {
 var controller = this.get('loginController');
-console.log("login error: " + error);
 this.setAuthenticated(false);
 if (request.status == 403) {
   var responseMessage = request.responseText;
@@ -458,7 +452,6 @@ App.Router = Em.Router.extend({
 });
 this.set('loggedIn', false);
 this.clearAllSteps();
-console.log("Log off: " + App.router.getClusterName());
 this.set('loginController.loginName', '');
 this.set('loginController.password', '');
 // When logOff is called by Sign Out button, context contains event 
object. As it is only case we should send logoff request, we are checking 
context below.
@@ -477,13 +470,11 @@ App.Router = Em.Router.extend({
   },
 
   logOffSuccessCallback: function () {
-console.log("invoked logout on the server successfully");
 var applicationController = App.router.get('applicationController');
 applicationController.set('isPollerRunning', false);
   },
 
   logOffErrorCallback: function () {
-console.log("failed to invoke logout on the server");
   },
 
   /**
@@ -527,11 +518,8 @@ App.Router = Em.Router.extend({
   // If the path is not relative, silently ignore it - if the path is an 
absolute URL, the user
   // may be routed to a different server where the possibility exists for 
a phishing attack.
   if ((preferredPath.startsWith('/') || preferredPath.startsWith('#')) && 
!preferredPath.contains('#/login')) {
-console.log("INFO: Routing to preferred path: " + preferredPath);
 window.location = preferredPath;
 isRestored = true;
-  } else {
-console.log("WARNING: Ignoring preferred path since it is not a 
relative URL: " + preferredPath);
   }
   // Unset preferedPath
   this.set('preferedPath', null);
@@ -549,7 +537,6 @@ App.Router = Em.Router.extend({
   if (user) {
 if (user.admin) {
   App.set('isAdmin', true);
-  console.log('Administrator logged in');
 }
 if (user.operator) {
   App.set('isOperator', true);
@@ -580,7 +567,6 @@ App.Router = Em.Router.extend({
 router.getAuthenticated().done(function (loggedIn) {
   if (loggedIn) {
 Ember.run.next(function () {
-  console.log(router.getLoginName() + ' already authenticated.  
Redirecting...');
   router.getSection(function (route) {
 route

[1/2] ambari git commit: AMBARI-13790. "Username" and "Password" inputs are inactive after Sign Out during deploy

2015-11-09 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 47ab1426e -> d7f6f18e5


AMBARI-13790. "Username" and "Password" inputs are inactive after Sign Out 
during deploy


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

Branch: refs/heads/trunk
Commit: d7f6f18e547a230134b720d731f5e3d75bd4f6c5
Parents: ac8147b
Author: Alex Antonenko 
Authored: Mon Nov 9 18:50:46 2015 +0200
Committer: Alex Antonenko 
Committed: Mon Nov 9 19:06:19 2015 +0200

--
 ambari-web/app/router.js | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d7f6f18e/ambari-web/app/router.js
--
diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js
index 1da6edf..59e2251 100644
--- a/ambari-web/app/router.js
+++ b/ambari-web/app/router.js
@@ -271,6 +271,7 @@ App.Router = Em.Router.extend({
   },
 
   loginSuccessCallback: function(data, opt, params) {
+App.router.set('loginController.isSubmitDisabled', false);
 App.usersMapper.map({"items": [data]});
 this.setUserLoggedIn(decodeURIComponent(params.loginName));
 var requestData = {



[1/2] ambari git commit: AMBARI-13785. JS errors on leaving pages with graphs before they're loaded

2015-11-09 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 101666b03 -> 0936c4357


AMBARI-13785. JS errors on leaving pages with graphs before they're loaded


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

Branch: refs/heads/branch-2.1
Commit: 84fc9cd75c0a93436743d05f1630e2fdcd1b7b95
Parents: 101666b
Author: Alex Antonenko 
Authored: Mon Nov 9 19:02:25 2015 +0200
Committer: Alex Antonenko 
Committed: Mon Nov 9 19:02:25 2015 +0200

--
 ambari-web/app/assets/test/tests.js |  1 +
 ambari-web/app/utils/ember_reopen.js| 12 +++
 .../app/views/common/chart/linear_time.js   | 15 ++--
 ambari-web/test/utils/ember_reopen_test.js  | 81 
 4 files changed, 103 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/84fc9cd7/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 c2c6c30..59855a2 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -169,6 +169,7 @@ var files = ['test/init_model_test',
   'test/utils/date/timezone_test',
   'test/utils/data_manipulation_test',
   'test/utils/config_test',
+  'test/utils/ember_reopen_test',
   'test/utils/form_field_test',
   'test/utils/host_progress_popup_test',
   'test/utils/misc_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/84fc9cd7/ambari-web/app/utils/ember_reopen.js
--
diff --git a/ambari-web/app/utils/ember_reopen.js 
b/ambari-web/app/utils/ember_reopen.js
index 4446f1e..cf01371 100644
--- a/ambari-web/app/utils/ember_reopen.js
+++ b/ambari-web/app/utils/ember_reopen.js
@@ -185,6 +185,18 @@ Em.View.reopen({
 } else {
   console.debug('Calling set on destroyed view');
 }
+  },
+
+  /**
+   * overwritten setProperties method of Ember.View to avoid uncaught errors
+   * when trying to set multiple properties of destroyed view
+   */
+  setProperties: function(hash){
+if(!this.get('isDestroyed') && !this.get('isDestroying')){
+  this._super(hash);
+} else {
+  console.debug('Calling setProperties on destroyed view');
+}
   }
 });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/84fc9cd7/ambari-web/app/views/common/chart/linear_time.js
--
diff --git a/ambari-web/app/views/common/chart/linear_time.js 
b/ambari-web/app/views/common/chart/linear_time.js
index a6bd9a4..efea946 100644
--- a/ambari-web/app/views/common/chart/linear_time.js
+++ b/ambari-web/app/views/common/chart/linear_time.js
@@ -299,12 +299,15 @@ App.ChartLinearTimeView = 
Ember.View.extend(App.ExportMetricsMixin, {
   setExportTooltip: function () {
 if (this.get('isReady')) {
   Em.run.next(this, function () {
-this.$('.corner-icon').on('mouseover', function () {
-  $(this).closest("[rel='ZoomInTooltip']").trigger('mouseleave');
-});
-App.tooltip(this.$('.corner-icon > .icon-save'), {
-  title: Em.I18n.t('common.export')
-});
+var icon = this.$('.corner-icon');
+if (icon) {
+  icon.on('mouseover', function () {
+$(this).closest("[rel='ZoomInTooltip']").trigger('mouseleave');
+  });
+  App.tooltip(icon.children('.icon-save'), {
+title: Em.I18n.t('common.export')
+  });
+}
   });
 }
   }.observes('isReady'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/84fc9cd7/ambari-web/test/utils/ember_reopen_test.js
--
diff --git a/ambari-web/test/utils/ember_reopen_test.js 
b/ambari-web/test/utils/ember_reopen_test.js
new file mode 100644
index 000..eda5e81
--- /dev/null
+++ b/ambari-web/test/utils/ember_reopen_test.js
@@ -0,0 +1,81 @@
+/**
+ * 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 KI

ambari git commit: AMBARI-13795. Ambari Agent cannot talk to server if "test -w" command hangs (aonishuk)

2015-11-09 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 9cb0cc07a -> 47ab1426e


AMBARI-13795. Ambari Agent cannot talk to server if "test -w" command hangs 
(aonishuk)


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

Branch: refs/heads/trunk
Commit: 47ab1426e6e1f13a794ec0a7e73fdbfec8339192
Parents: 9cb0cc0
Author: Andrew Onishuk 
Authored: Mon Nov 9 18:59:23 2015 +0200
Committer: Andrew Onishuk 
Committed: Mon Nov 9 18:59:23 2015 +0200

--
 .../src/main/python/ambari_agent/Hardware.py| 11 ++
 .../src/main/python/ambari_agent/main.py| 22 ++--
 .../src/test/python/ambari_agent/TestMain.py|  4 ++--
 3 files changed, 20 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/47ab1426/ambari-agent/src/main/python/ambari_agent/Hardware.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/Hardware.py 
b/ambari-agent/src/main/python/ambari_agent/Hardware.py
index 36b4f4b..17acdf2 100644
--- a/ambari-agent/src/main/python/ambari_agent/Hardware.py
+++ b/ambari-agent/src/main/python/ambari_agent/Hardware.py
@@ -21,6 +21,8 @@ limitations under the License.
 import os.path
 import logging
 import subprocess
+from resource_management.core.shell import call
+from resource_management.core.exceptions import ExecuteTimeoutException
 from ambari_commons.constants import AMBARI_SUDO_BINARY
 from ambari_commons.shell import shellRunner
 from Facter import Facter
@@ -99,11 +101,12 @@ class Hardware:
 
   @staticmethod
   def _chk_mount(mountpoint):
-if subprocess.call("{0} test -w '{1}'".format(AMBARI_SUDO_BINARY, 
mountpoint), shell=True) == 0:
-  return True
-else:
+try:
+  return call(['test', '-w', mountpoint], sudo=True, 
timeout=int(Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_DEFAULT)/2)[0] == 0
+except ExecuteTimeoutException:
+  logger.exception("Exception happened while checking mount 
{0}".format(mountpoint))
   return False
-
+
   @staticmethod
   @OsFamilyFuncImpl(OSConst.WINSRV_FAMILY)
   def osdisks(config = None):

http://git-wip-us.apache.org/repos/asf/ambari/blob/47ab1426/ambari-agent/src/main/python/ambari_agent/main.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/main.py 
b/ambari-agent/src/main/python/ambari_agent/main.py
index 72f9b04..74697c5 100644
--- a/ambari-agent/src/main/python/ambari_agent/main.py
+++ b/ambari-agent/src/main/python/ambari_agent/main.py
@@ -45,6 +45,7 @@ from ambari_commons import shell
 import HeartbeatHandlers
 from HeartbeatHandlers import bind_signal_handlers
 from ambari_commons.constants import AMBARI_SUDO_BINARY
+from resource_management.core.logger import Logger
 logger = logging.getLogger()
 alerts_logger = logging.getLogger('ambari_alerts')
 
@@ -58,20 +59,16 @@ IS_LINUX = platform.system() == "Linux"
 SYSLOG_FORMAT_STRING = ' ambari_agent - %(filename)s - [%(process)d] - 
%(name)s - %(levelname)s - %(message)s'
 SYSLOG_FORMATTER = logging.Formatter(SYSLOG_FORMAT_STRING)
 
-def setup_logging(logger, filename, verbose):
+def setup_logging(logger, filename, logging_level):
   formatter = logging.Formatter(formatstr)
   rotateLog = logging.handlers.RotatingFileHandler(filename, "a", 1000, 25)
   rotateLog.setFormatter(formatter)
   logger.addHandler(rotateLog)
   
-  if verbose:
-logging.basicConfig(format=formatstr, level=logging.DEBUG, 
filename=filename)
-logger.setLevel(logging.DEBUG)
-logger.info("loglevel=logging.DEBUG")
-  else:
-logging.basicConfig(format=formatstr, level=logging.INFO, 
filename=filename)
-logger.setLevel(logging.INFO)
-logger.info("loglevel=logging.INFO")
+  logging.basicConfig(format=formatstr, level=logging_level, filename=filename)
+  logger.setLevel(logging_level)
+  
logger.info("loglevel=logging.{0}".format(logging._levelNames[logging_level]))
+
 
 def add_syslog_handler(logger):
 
@@ -235,10 +232,13 @@ def main(heartbeat_stop_callback=None):
 
   expected_hostname = options.expected_hostname
 
-  setup_logging(logger, AmbariConfig.AmbariConfig.getLogFile(), 
options.verbose)
+  logging_level = logging.DEBUG if options.verbose else logging.INFO
+
+  setup_logging(logger, AmbariConfig.AmbariConfig.getLogFile(), logging_level)
   global is_logger_setup
   is_logger_setup = True
-  setup_logging(alerts_logger, AmbariConfig.AmbariConfig.getAlertsLogFile(), 
options.verbose)
+  setup_logging(alerts_logger, AmbariConfig.AmbariConfig.getAlertsLogFile(), 
logging_level)
+  Logger.initialize_logger('resource_management',

ambari git commit: AMBARI-13795. Ambari Agent cannot talk to server if "test -w" command hangs (aonishuk)

2015-11-09 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 65e87e692 -> 101666b03


AMBARI-13795. Ambari Agent cannot talk to server if "test -w" command hangs 
(aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: 101666b031a0040fa246e21e3123d237e9b9d753
Parents: 65e87e6
Author: Andrew Onishuk 
Authored: Mon Nov 9 18:58:47 2015 +0200
Committer: Andrew Onishuk 
Committed: Mon Nov 9 18:58:47 2015 +0200

--
 .../src/main/python/ambari_agent/Hardware.py| 11 +++
 .../src/main/python/ambari_agent/main.py| 20 +---
 .../src/test/python/ambari_agent/TestMain.py|  4 ++--
 3 files changed, 18 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/101666b0/ambari-agent/src/main/python/ambari_agent/Hardware.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/Hardware.py 
b/ambari-agent/src/main/python/ambari_agent/Hardware.py
index 36b4f4b..17acdf2 100644
--- a/ambari-agent/src/main/python/ambari_agent/Hardware.py
+++ b/ambari-agent/src/main/python/ambari_agent/Hardware.py
@@ -21,6 +21,8 @@ limitations under the License.
 import os.path
 import logging
 import subprocess
+from resource_management.core.shell import call
+from resource_management.core.exceptions import ExecuteTimeoutException
 from ambari_commons.constants import AMBARI_SUDO_BINARY
 from ambari_commons.shell import shellRunner
 from Facter import Facter
@@ -99,11 +101,12 @@ class Hardware:
 
   @staticmethod
   def _chk_mount(mountpoint):
-if subprocess.call("{0} test -w '{1}'".format(AMBARI_SUDO_BINARY, 
mountpoint), shell=True) == 0:
-  return True
-else:
+try:
+  return call(['test', '-w', mountpoint], sudo=True, 
timeout=int(Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_DEFAULT)/2)[0] == 0
+except ExecuteTimeoutException:
+  logger.exception("Exception happened while checking mount 
{0}".format(mountpoint))
   return False
-
+
   @staticmethod
   @OsFamilyFuncImpl(OSConst.WINSRV_FAMILY)
   def osdisks(config = None):

http://git-wip-us.apache.org/repos/asf/ambari/blob/101666b0/ambari-agent/src/main/python/ambari_agent/main.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/main.py 
b/ambari-agent/src/main/python/ambari_agent/main.py
index fb5b4b1..b4ee0e2 100644
--- a/ambari-agent/src/main/python/ambari_agent/main.py
+++ b/ambari-agent/src/main/python/ambari_agent/main.py
@@ -45,6 +45,7 @@ from ambari_commons import shell
 import HeartbeatHandlers
 from HeartbeatHandlers import bind_signal_handlers
 from ambari_commons.constants import AMBARI_SUDO_BINARY
+from resource_management.core.logger import Logger
 logger = logging.getLogger()
 
 formatstr = "%(levelname)s %(asctime)s %(filename)s:%(lineno)d - %(message)s"
@@ -58,20 +59,15 @@ SYSLOG_FORMAT_STRING = ' ambari_agent - %(filename)s - 
[%(process)d] - %(name)s
 SYSLOG_FORMATTER = logging.Formatter(SYSLOG_FORMAT_STRING)
 
 
-def setup_logging(verbose):
+def setup_logging(logging_level):
   formatter = logging.Formatter(formatstr)
   rotateLog = 
logging.handlers.RotatingFileHandler(AmbariConfig.AmbariConfig.getLogFile(), 
"a", 1000, 25)
   rotateLog.setFormatter(formatter)
   logger.addHandler(rotateLog)
   
-  if verbose:
-logging.basicConfig(format=formatstr, level=logging.DEBUG, 
filename=AmbariConfig.AmbariConfig.getLogFile())
-logger.setLevel(logging.DEBUG)
-logger.info("loglevel=logging.DEBUG")
-  else:
-logging.basicConfig(format=formatstr, level=logging.INFO, 
filename=AmbariConfig.AmbariConfig.getLogFile())
-logger.setLevel(logging.INFO)
-logger.info("loglevel=logging.INFO")
+  logging.basicConfig(format=formatstr, level=logging_level, 
filename=AmbariConfig.AmbariConfig.getLogFile())
+  logger.setLevel(logging_level)
+  
logger.info("loglevel=logging.{0}".format(logging._levelNames[logging_level]))
 
   global is_logger_setup
   is_logger_setup = True
@@ -237,8 +233,10 @@ def main(heartbeat_stop_callback=None):
   expected_hostname = options.expected_hostname
 
   current_user = getpass.getuser()
-
-  setup_logging(options.verbose)
+  
+  logging_level = logging.DEBUG if options.verbose else logging.INFO
+  setup_logging(logging_level)
+  Logger.initialize_logger('resource_management', logging_level=logging_level)
 
   default_cfg = {'agent': {'prefix': '/home/ambari'}}
   config.load(default_cfg)

http://git-wip-us.apache.org/repos/asf/ambari/blob/101666b0/ambari-agent/src/test/python/ambari_agent/TestMain.py
--

ambari git commit: AMBARI-13778. Submitting kerberos descriptor should be optional in Blueprint or Cluster template json. (Sandor Magyari via rnettleton)

2015-11-09 Thread rnettleton
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 84dfed996 -> 65e87e692


AMBARI-13778. Submitting kerberos descriptor should be optional in Blueprint or 
Cluster template json. (Sandor Magyari via rnettleton)


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

Branch: refs/heads/branch-2.1
Commit: 65e87e692992d9eabe0110bd07cf7ba8935d39d6
Parents: 84dfed9
Author: Bob Nettleton 
Authored: Mon Nov 9 10:49:51 2015 -0500
Committer: Bob Nettleton 
Committed: Mon Nov 9 10:49:51 2015 -0500

--
 .../server/topology/SecurityConfigurationFactory.java| 11 ---
 .../apache/ambari/server/topology/TopologyManager.java   |  8 ++--
 .../topology/SecurityConfigurationFactoryTest.java   |  2 +-
 3 files changed, 11 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/65e87e69/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfigurationFactory.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfigurationFactory.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfigurationFactory.java
index 5f8cde1..8a31a42 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfigurationFactory.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfigurationFactory.java
@@ -99,12 +99,6 @@ public class SecurityConfigurationFactory {
 
   Object descriptorJsonMap = 
securityProperties.get(KERBEROS_DESCRIPTOR_PROPERTY_ID);
 
-  if (descriptorReference == null && descriptorJsonMap == null) {
-LOGGER.error("Both kerberos descriptor and kerberos descriptor 
reference are null in the security configuration!");
-throw new IllegalArgumentException(KERBEROS_DESCRIPTOR_PROPERTY_ID + " 
or "
-+ KERBEROS_DESCRIPTOR_REFERENCE_PROPERTY_ID + " is required for 
KERBEROS security setup.");
-  }
-
   if (descriptorReference != null && descriptorJsonMap != null) {
 LOGGER.error("Both kerberos descriptor and kerberos descriptor 
reference are set in the security configuration!");
 throw new IllegalArgumentException("Usage of properties : " + 
KERBEROS_DESCRIPTOR_PROPERTY_ID + " and "
@@ -120,9 +114,12 @@ public class SecurityConfigurationFactory {
   descriptorReference = persistKerberosDescriptor(descriptorText);
 }
 securityConfiguration = new 
SecurityConfiguration(SecurityType.KERBEROS, descriptorReference, 
descriptorText);
-  } else { // this means the reference is not null
+  } else if (descriptorReference != null) { // this means the reference is 
not null
 LOGGER.debug("Found descriptor reference: {}", descriptorReference);
 securityConfiguration = 
loadSecurityConfigurationByReference(descriptorReference);
+  } else {
+LOGGER.debug("There is no security descriptor found in the request");
+securityConfiguration = new 
SecurityConfiguration(SecurityType.KERBEROS);
   }
 } else {
   LOGGER.debug("There is no security configuration found in the request");

http://git-wip-us.apache.org/repos/asf/ambari/blob/65e87e69/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
index 7f571ce..a688464 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
@@ -139,7 +139,10 @@ public class TopologyManager {
   // create Cluster resource with security_type = KERBEROS, this will 
trigger cluster Kerberization
   // upon host install task execution
   ambariContext.createAmbariResources(topology, clusterName, 
securityConfiguration.getType());
-  submitKerberosDescriptorAsArtifact(clusterName, 
securityConfiguration.getDescriptor());
+  if (securityConfiguration.getDescriptor() != null) {
+submitKerberosDescriptorAsArtifact(clusterName, 
securityConfiguration.getDescriptor());
+  }
+
   Credential credential = 
request.getCredentialsMap().get(KDC_ADMIN_CREDENTIAL);
   if (credential == null) {
 throw new InvalidTopologyException(KDC_ADMIN_CREDENTIAL + " is missing 
from request.");
@@ -219,7 +222,8 @@ public class TopologyManager {
   // todo -

ambari git commit: AMBARI-13778. Submitting kerberos descriptor should be optional in Blueprint or Cluster template json. (Sandor Magyari via rnettleton)

2015-11-09 Thread rnettleton
Repository: ambari
Updated Branches:
  refs/heads/trunk 88c850bbe -> 9cb0cc07a


AMBARI-13778. Submitting kerberos descriptor should be optional in Blueprint or 
Cluster template json. (Sandor Magyari via rnettleton)


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

Branch: refs/heads/trunk
Commit: 9cb0cc07abbcf42317f56a777f758b4fa60f77b3
Parents: 88c850b
Author: Bob Nettleton 
Authored: Mon Nov 9 10:30:40 2015 -0500
Committer: Bob Nettleton 
Committed: Mon Nov 9 10:31:07 2015 -0500

--
 .../server/topology/SecurityConfigurationFactory.java| 11 ---
 .../apache/ambari/server/topology/TopologyManager.java   |  8 ++--
 .../topology/SecurityConfigurationFactoryTest.java   |  2 +-
 3 files changed, 11 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9cb0cc07/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfigurationFactory.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfigurationFactory.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfigurationFactory.java
index 5f8cde1..8a31a42 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfigurationFactory.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/SecurityConfigurationFactory.java
@@ -99,12 +99,6 @@ public class SecurityConfigurationFactory {
 
   Object descriptorJsonMap = 
securityProperties.get(KERBEROS_DESCRIPTOR_PROPERTY_ID);
 
-  if (descriptorReference == null && descriptorJsonMap == null) {
-LOGGER.error("Both kerberos descriptor and kerberos descriptor 
reference are null in the security configuration!");
-throw new IllegalArgumentException(KERBEROS_DESCRIPTOR_PROPERTY_ID + " 
or "
-+ KERBEROS_DESCRIPTOR_REFERENCE_PROPERTY_ID + " is required for 
KERBEROS security setup.");
-  }
-
   if (descriptorReference != null && descriptorJsonMap != null) {
 LOGGER.error("Both kerberos descriptor and kerberos descriptor 
reference are set in the security configuration!");
 throw new IllegalArgumentException("Usage of properties : " + 
KERBEROS_DESCRIPTOR_PROPERTY_ID + " and "
@@ -120,9 +114,12 @@ public class SecurityConfigurationFactory {
   descriptorReference = persistKerberosDescriptor(descriptorText);
 }
 securityConfiguration = new 
SecurityConfiguration(SecurityType.KERBEROS, descriptorReference, 
descriptorText);
-  } else { // this means the reference is not null
+  } else if (descriptorReference != null) { // this means the reference is 
not null
 LOGGER.debug("Found descriptor reference: {}", descriptorReference);
 securityConfiguration = 
loadSecurityConfigurationByReference(descriptorReference);
+  } else {
+LOGGER.debug("There is no security descriptor found in the request");
+securityConfiguration = new 
SecurityConfiguration(SecurityType.KERBEROS);
   }
 } else {
   LOGGER.debug("There is no security configuration found in the request");

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cb0cc07/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
index 7f571ce..a688464 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java
@@ -139,7 +139,10 @@ public class TopologyManager {
   // create Cluster resource with security_type = KERBEROS, this will 
trigger cluster Kerberization
   // upon host install task execution
   ambariContext.createAmbariResources(topology, clusterName, 
securityConfiguration.getType());
-  submitKerberosDescriptorAsArtifact(clusterName, 
securityConfiguration.getDescriptor());
+  if (securityConfiguration.getDescriptor() != null) {
+submitKerberosDescriptorAsArtifact(clusterName, 
securityConfiguration.getDescriptor());
+  }
+
   Credential credential = 
request.getCredentialsMap().get(KDC_ADMIN_CREDENTIAL);
   if (credential == null) {
 throw new InvalidTopologyException(KDC_ADMIN_CREDENTIAL + " is missing 
from request.");
@@ -219,7 +222,8 @@ public class TopologyManager {
   // todo - perform t

ambari git commit: AMBARI-13774 nimbus.authorizer not removed when security disabled (dsen)

2015-11-09 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 4e4112423 -> 84dfed996


AMBARI-13774 nimbus.authorizer not removed when security disabled (dsen)


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

Branch: refs/heads/branch-2.1
Commit: 84dfed9968ce8224d49540a7572cd90b6d4538c2
Parents: 4e41124
Author: Dmytro Sen 
Authored: Mon Nov 9 16:31:26 2015 +0200
Committer: Dmytro Sen 
Committed: Mon Nov 9 16:32:20 2015 +0200

--
 .../stacks/HDP/2.2/services/STORM/configuration/storm-site.xml  | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/84dfed99/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/configuration/storm-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/configuration/storm-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/configuration/storm-site.xml
index 29dc700..88b9364 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/configuration/storm-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/configuration/storm-site.xml
@@ -112,7 +112,6 @@
 
   
 nimbus.authorizer
-backtype.storm.security.auth.authorizer.SimpleACLAuthorizer
 Log directory for Storm.
 
   



ambari git commit: AMBARI-13774 nimbus.authorizer not removed when security disabled (dsen)

2015-11-09 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk 18a25ce13 -> 88c850bbe


AMBARI-13774 nimbus.authorizer not removed when security disabled (dsen)


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

Branch: refs/heads/trunk
Commit: 88c850bbef0025b0016869fe66ec25f6edc94d81
Parents: 18a25ce
Author: Dmytro Sen 
Authored: Mon Nov 9 16:31:26 2015 +0200
Committer: Dmytro Sen 
Committed: Mon Nov 9 16:31:26 2015 +0200

--
 .../stacks/HDP/2.2/services/STORM/configuration/storm-site.xml  | 1 -
 1 file changed, 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/88c850bb/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/configuration/storm-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/configuration/storm-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/configuration/storm-site.xml
index 29dc700..88b9364 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/configuration/storm-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/STORM/configuration/storm-site.xml
@@ -112,7 +112,6 @@
 
   
 nimbus.authorizer
-backtype.storm.security.auth.authorizer.SimpleACLAuthorizer
 Log directory for Storm.
 
   



[1/2] ambari git commit: AMBARI-13789. Fix unit tests failures on Mac (aonishuk)

2015-11-09 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 aaeac45b9 -> 4e4112423
  refs/heads/trunk 48ad32a20 -> 18a25ce13


AMBARI-13789. Fix unit tests failures on Mac (aonishuk)


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

Branch: refs/heads/trunk
Commit: 18a25ce13108d3ef0de857a3db412ebb7a559ea6
Parents: 48ad32a
Author: Andrew Onishuk 
Authored: Mon Nov 9 15:15:31 2015 +0200
Committer: Andrew Onishuk 
Committed: Mon Nov 9 15:15:31 2015 +0200

--
 ambari-server/src/test/python/stacks/utils/RMFTestCase.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/18a25ce1/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
--
diff --git a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py 
b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
index 0420161..ca32649 100644
--- a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
+++ b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
@@ -113,12 +113,11 @@ class RMFTestCase(TestCase):
 try:
   with patch.object(platform, 'linux_distribution', return_value=os_type):
 script_module = imp.load_source(classname, script_path)
+script_class_inst = RMFTestCase._get_attr(script_module, classname)()
+method = RMFTestCase._get_attr(script_class_inst, command)
 except IOError, err:
   raise RuntimeError("Cannot load class %s from %s: %s" % (classname, 
norm_path, err.message))
 
-script_class_inst = RMFTestCase._get_attr(script_module, classname)()
-method = RMFTestCase._get_attr(script_class_inst, command)
-
 # Reload params import, otherwise it won't change properties during next 
import
 if 'params' in sys.modules:  
   del(sys.modules["params"])



[2/2] ambari git commit: AMBARI-13789. Fix unit tests failures on Mac (aonishuk)

2015-11-09 Thread aonishuk
AMBARI-13789. Fix unit tests failures on Mac (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: 4e4112423ef76bcb5e695b17fbe5d0fbaa650d94
Parents: aaeac45
Author: Andrew Onishuk 
Authored: Mon Nov 9 15:15:34 2015 +0200
Committer: Andrew Onishuk 
Committed: Mon Nov 9 15:15:34 2015 +0200

--
 ambari-server/src/test/python/stacks/utils/RMFTestCase.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4e411242/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
--
diff --git a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py 
b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
index 0420161..ca32649 100644
--- a/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
+++ b/ambari-server/src/test/python/stacks/utils/RMFTestCase.py
@@ -113,12 +113,11 @@ class RMFTestCase(TestCase):
 try:
   with patch.object(platform, 'linux_distribution', return_value=os_type):
 script_module = imp.load_source(classname, script_path)
+script_class_inst = RMFTestCase._get_attr(script_module, classname)()
+method = RMFTestCase._get_attr(script_class_inst, command)
 except IOError, err:
   raise RuntimeError("Cannot load class %s from %s: %s" % (classname, 
norm_path, err.message))
 
-script_class_inst = RMFTestCase._get_attr(script_module, classname)()
-method = RMFTestCase._get_attr(script_class_inst, command)
-
 # Reload params import, otherwise it won't change properties during next 
import
 if 'params' in sys.modules:  
   del(sys.modules["params"])



ambari git commit: AMBARI-13777 Ambari Metrics Collector fails to start if /tmp mounted with noexec (dsen)

2015-11-09 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 7e31c06f6 -> aaeac45b9


AMBARI-13777 Ambari Metrics Collector fails to start if /tmp mounted with 
noexec (dsen)


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

Branch: refs/heads/branch-2.1
Commit: aaeac45b9df80d39c567f084bd568813a3e678c5
Parents: 7e31c06
Author: Dmytro Sen 
Authored: Mon Nov 9 13:12:03 2015 +0200
Committer: Dmytro Sen 
Committed: Mon Nov 9 13:14:00 2015 +0200

--
 .../conf/unix/ambari-metrics-collector   | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/aaeac45b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
 
b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
index 72d4460..b8d6602 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
@@ -92,6 +92,10 @@ function enable_normalization
 command="$command \n alter_async '$table', {NORMALIZATION_ENABLED => 
'true'}"
   done
   echo -e ${command} | ${HBASE_CMD} --config ${HBASE_CONF_DIR} shell > 
/dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "WARNING: Failed to enable Ambari Metrics data model normalization."
+ >&2 echo "WARNING: Failed to enable Ambari Metrics data model 
normalization."
+  fi
 }
 
 function hadoop_java_setup
@@ -224,11 +228,12 @@ function start()
 sleep 5
   done
   if [ $? -ne 0 ]; then
-echo "Ambari Metrics data model initialization failed."
-exit -1
+echo "WARNING: Ambari Metrics data model initialization failed."
+ >&2 echo "WARNING: Ambari Metrics data model initialization failed."
+  else
+enable_normalization
   fi
 
-  enable_normalization
   }
 
 function stop()



ambari git commit: AMBARI-13777 Ambari Metrics Collector fails to start if /tmp mounted with noexec (dsen)

2015-11-09 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk da8ca2ae3 -> 48ad32a20


AMBARI-13777 Ambari Metrics Collector fails to start if /tmp mounted with 
noexec (dsen)


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

Branch: refs/heads/trunk
Commit: 48ad32a2000e4e02fd915a53df4488685595e5cb
Parents: da8ca2a
Author: Dmytro Sen 
Authored: Mon Nov 9 13:12:03 2015 +0200
Committer: Dmytro Sen 
Committed: Mon Nov 9 13:12:03 2015 +0200

--
 .../conf/unix/ambari-metrics-collector   | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/48ad32a2/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
 
b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
index 72d4460..b8d6602 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/conf/unix/ambari-metrics-collector
@@ -92,6 +92,10 @@ function enable_normalization
 command="$command \n alter_async '$table', {NORMALIZATION_ENABLED => 
'true'}"
   done
   echo -e ${command} | ${HBASE_CMD} --config ${HBASE_CONF_DIR} shell > 
/dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "WARNING: Failed to enable Ambari Metrics data model normalization."
+ >&2 echo "WARNING: Failed to enable Ambari Metrics data model 
normalization."
+  fi
 }
 
 function hadoop_java_setup
@@ -224,11 +228,12 @@ function start()
 sleep 5
   done
   if [ $? -ne 0 ]; then
-echo "Ambari Metrics data model initialization failed."
-exit -1
+echo "WARNING: Ambari Metrics data model initialization failed."
+ >&2 echo "WARNING: Ambari Metrics data model initialization failed."
+  else
+enable_normalization
   fi
 
-  enable_normalization
   }
 
 function stop()



[2/2] ambari git commit: AMBARI-13787. Move config_property_helper to the App.* namespace (onechiporenko)

2015-11-09 Thread onechiporenko
AMBARI-13787. Move config_property_helper to the App.* namespace (onechiporenko)


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

Branch: refs/heads/trunk
Commit: da8ca2ae386874ba3b8d28f355578c2f340a0d13
Parents: 618d843
Author: Oleg Nechiporenko 
Authored: Mon Nov 9 12:07:19 2015 +0200
Committer: Oleg Nechiporenko 
Committed: Mon Nov 9 12:07:19 2015 +0200

--
 ambari-web/app/assets/test/tests.js |2 +-
 .../wizard/slave_component_groups_controller.js |5 +-
 .../app/controllers/wizard/step7_controller.js  |4 +-
 ambari-web/app/initialize.js|1 +
 .../app/utils/configs/config_initializer.js |  908 +
 .../app/utils/configs/config_property_helper.js |  905 -
 .../wizard/slave_component_groups_controller.js |5 +-
 .../objects/service_config_category_test.js |1 -
 .../objects/service_config_property_test.js |1 -
 .../configs/objects/service_config_test.js  |1 -
 .../utils/configs/config_initializer_test.js| 1271 ++
 .../configs/config_property_helper_test.js  | 1271 --
 12 files changed, 2187 insertions(+), 2188 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/da8ca2ae/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 805d565..71c69db 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -181,7 +181,7 @@ var files = [
   'test/utils/ui_effects_test',
   'test/utils/updater_test',
   'test/utils/configs/database_test',
-  'test/utils/configs/config_property_helper_test',
+  'test/utils/configs/config_initializer_test',
   'test/utils/configs/modification_handlers/modification_handler_test',
   'test/utils/configs/modification_handlers/misc_test',
   'test/utils/load_timer_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/da8ca2ae/ambari-web/app/controllers/wizard/slave_component_groups_controller.js
--
diff --git 
a/ambari-web/app/controllers/wizard/slave_component_groups_controller.js 
b/ambari-web/app/controllers/wizard/slave_component_groups_controller.js
index 584fdf2..57f1ff5 100644
--- a/ambari-web/app/controllers/wizard/slave_component_groups_controller.js
+++ b/ambari-web/app/controllers/wizard/slave_component_groups_controller.js
@@ -16,7 +16,6 @@
  * limitations under the License.
  */
 var App = require('app');
-var configPropertyHelper = require('utils/configs/config_property_helper');
 /**
  * Used to manage slave component config. User could create different settings 
for separate group
  * @type {*}
@@ -102,10 +101,10 @@ App.SlaveComponentGroupsController = 
Em.ArrayController.extend({
 
   switch(serviceConfigProperty.name){
 case 'dfs_data_dir' :
-  configPropertyHelper.initialValue(serviceConfigProperty);
+  App.ConfigInitializer.initialValue(serviceConfigProperty);
   break;
 case 'mapred_local_dir' :
-  configPropertyHelper.initialValue(serviceConfigProperty);
+  App.ConfigInitializer.initialValue(serviceConfigProperty);
   break;
   }
   configs.pushObject(serviceConfigProperty);

http://git-wip-us.apache.org/repos/asf/ambari/blob/da8ca2ae/ambari-web/app/controllers/wizard/step7_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js 
b/ambari-web/app/controllers/wizard/step7_controller.js
index c879acc..f5f78ff 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -17,7 +17,7 @@
  */
 
 var App = require('app');
-var configPropertyHelper = require('utils/configs/config_property_helper');
+
 /**
  * By Step 7, we have the following information stored in App.db and set on 
this
  * controller by the router.
@@ -864,7 +864,7 @@ App.WizardStep7Controller = 
Em.Controller.extend(App.ServerValidatorMixin, App.E
 var serviceConfigProperty = App.ServiceConfigProperty.create(_config);
 this.updateHostOverrides(serviceConfigProperty, _config);
 if (!storedConfigs && !serviceConfigProperty.get('hasInitialValue')) {
-  configPropertyHelper.initialValue(serviceConfigProperty, localDB, 
dependencies);
+  App.ConfigInitializer.initialValue(serviceConfigProperty, localDB, 
dependencies);
 }
 serviceConfigProperty.validate();
 configs

[1/2] ambari git commit: AMBARI-13787. Move config_property_helper to the App.* namespace (onechiporenko)

2015-11-09 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 618d843c1 -> da8ca2ae3


http://git-wip-us.apache.org/repos/asf/ambari/blob/da8ca2ae/ambari-web/test/utils/configs/config_initializer_test.js
--
diff --git a/ambari-web/test/utils/configs/config_initializer_test.js 
b/ambari-web/test/utils/configs/config_initializer_test.js
new file mode 100644
index 000..fe55e69
--- /dev/null
+++ b/ambari-web/test/utils/configs/config_initializer_test.js
@@ -0,0 +1,1271 @@
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+require('models/configs/objects/service_config_property');
+require('utils/configs/config_initializer');
+
+var serviceConfig,
+  group,
+  serviceConfigProperty,
+
+  components = [
+{
+  name: 'NameNode',
+  master: true
+},
+{
+  name: 'SNameNode',
+  master: true
+},
+{
+  name: 'JobTracker',
+  master: true
+},
+{
+  name: 'HBase Master',
+  master: true
+},
+{
+  name: 'Oozie Master',
+  master: true
+},
+{
+  name: 'Hive Metastore',
+  master: true
+},
+{
+  name: 'WebHCat Server',
+  master: true
+},
+{
+  name: 'ZooKeeper Server',
+  master: true
+},
+{
+  name: 'Ganglia',
+  master: true
+},
+{
+  name: 'DataNode',
+  slave: true
+},
+{
+  name: 'TaskTracker',
+  slave: true
+},
+{
+  name: 'RegionServer',
+  slave: true
+}
+  ],
+  masters = components.filterProperty('master'),
+  slaves = components.filterProperty('slave');
+
+describe('App.ConfigInitializer', function () {
+
+  beforeEach(function () {
+serviceConfigProperty = App.ServiceConfigProperty.create();
+  });
+
+  describe('#setRecommendedValue', function () {
+it('should change the recommended value', function () {
+  serviceConfigProperty.set('recommendedValue', 'value0');
+  App.ConfigInitializer.setRecommendedValue(serviceConfigProperty, /\d/, 
'1');
+  expect(serviceConfigProperty.get('recommendedValue')).to.equal('value1');
+});
+  });
+
+  describe('#initialValue', function () {
+
+var cases = {
+  'kafka.ganglia.metrics.host': [
+{
+  message: 'kafka.ganglia.metrics.host property should have the value 
of ganglia hostname when ganglia is selected',
+  localDB: {
+masterComponentHosts: [
+  {
+component: 'GANGLIA_SERVER',
+hostName: 'c6401'
+  }
+]
+  },
+  expected: 'c6401'
+},
+{
+  message: 'kafka.ganglia.metrics.host property should have the value 
"localhost" when ganglia is not selected',
+  localDB: {
+masterComponentHosts: [
+  {
+component: 'NAMENODE',
+hostName: 'c6401'
+  }
+]
+  },
+  expected: 'localhost'
+}
+  ],
+  'hive_database': [
+{
+  alwaysEnableManagedMySQLForHive: true,
+  currentStateName: '',
+  isManagedMySQLForHiveEnabled: false,
+  receivedValue: 'New MySQL Database',
+  value: 'New MySQL Database',
+  options: [
+{
+  displayName: 'New MySQL Database'
+}
+  ],
+  hidden: false
+},
+{
+  alwaysEnableManagedMySQLForHive: false,
+  currentStateName: 'configs',
+  isManagedMySQLForHiveEnabled: false,
+  receivedValue: 'New MySQL Database',
+  value: 'New MySQL Database',
+  options: [
+{
+  displayName: 'New MySQL Database'
+}
+  ],
+  hidden: false
+},
+{
+  alwaysEnableManagedMySQLForHive: false,
+  currentStateName: '',
+  isManagedMySQLForHiveEnabled: true,
+  receivedValue: 'New MySQL Database',
+  value: 'New MySQL Database',
+  options: [
+{
+  displayName: 'New MySQL Database'
+}
+  ],
+  hidden: false
+},