ambari git commit: AMBARI-11945 Configs: checkbox in dependent configs does not work. (ababiichuk)

2015-06-16 Thread ababiichuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 9531ed270 - 48da3d273


AMBARI-11945 Configs: checkbox in dependent configs does not work. (ababiichuk)


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

Branch: refs/heads/branch-2.1
Commit: 48da3d273e54a25dd786c064092c773425535395
Parents: 9531ed2
Author: aBabiichuk ababiic...@cybervisiontech.com
Authored: Tue Jun 16 16:05:34 2015 +0300
Committer: aBabiichuk ababiic...@cybervisiontech.com
Committed: Tue Jun 16 16:11:20 2015 +0300

--
 .../modal_popups/dependent_configs_list_popup.js| 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/48da3d27/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js
--
diff --git 
a/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js 
b/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js
index f552abf..3795841 100644
--- a/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js
+++ b/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js
@@ -37,15 +37,21 @@ App.showDependentConfigsPopup = function (configs, primary, 
secondary) {
 
   toggleAll: Em.Checkbox.extend({
 didInsertElement: function () {
-  this.set('checked', 
!this.get('parentView.parentView.configs').someProperty('saveRecommended', 
false));
+  this.updateCheckbox();
 },
 click: function () {
-  this.get('parentView.parentView.configs').setEach('saveRecommended', 
this.get('checked'));
+  Em.run.next(this, 'updateSaveRecommended');
 },
-updateCheckbox: function () {
-  console.log('should update its status');
+updateCheckboxObserver: function () {
+  Em.run.once(this, 'updateCheckbox');
+}.observes('parentView.parentView.configs.@each.saveRecommended'),
+
+updateCheckbox: function() {
   this.set('checked', 
!this.get('parentView.parentView.configs').someProperty('saveRecommended', 
false));
-}.observes('parentView.parentView.configs.@each.saveRecommended')
+},
+updateSaveRecommended: function() {
+  this.get('parentView.parentView.configs').setEach('saveRecommended', 
this.get('checked'));
+}
   })
 }),
 onPrimary: function () {



ambari git commit: AMBARI-11945 Configs: checkbox in dependent configs does not work. (ababiichuk)

2015-06-16 Thread ababiichuk
Repository: ambari
Updated Branches:
  refs/heads/trunk d13f7098b - 7b031f9e0


AMBARI-11945 Configs: checkbox in dependent configs does not work. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 7b031f9e0d7cfdba34ae317920d52fe21c28c8e4
Parents: d13f709
Author: aBabiichuk ababiic...@cybervisiontech.com
Authored: Tue Jun 16 14:25:53 2015 +0300
Committer: aBabiichuk ababiic...@cybervisiontech.com
Committed: Tue Jun 16 16:05:34 2015 +0300

--
 .../modal_popups/dependent_configs_list_popup.js| 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7b031f9e/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js
--
diff --git 
a/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js 
b/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js
index f552abf..3795841 100644
--- a/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js
+++ b/ambari-web/app/views/common/modal_popups/dependent_configs_list_popup.js
@@ -37,15 +37,21 @@ App.showDependentConfigsPopup = function (configs, primary, 
secondary) {
 
   toggleAll: Em.Checkbox.extend({
 didInsertElement: function () {
-  this.set('checked', 
!this.get('parentView.parentView.configs').someProperty('saveRecommended', 
false));
+  this.updateCheckbox();
 },
 click: function () {
-  this.get('parentView.parentView.configs').setEach('saveRecommended', 
this.get('checked'));
+  Em.run.next(this, 'updateSaveRecommended');
 },
-updateCheckbox: function () {
-  console.log('should update its status');
+updateCheckboxObserver: function () {
+  Em.run.once(this, 'updateCheckbox');
+}.observes('parentView.parentView.configs.@each.saveRecommended'),
+
+updateCheckbox: function() {
   this.set('checked', 
!this.get('parentView.parentView.configs').someProperty('saveRecommended', 
false));
-}.observes('parentView.parentView.configs.@each.saveRecommended')
+},
+updateSaveRecommended: function() {
+  this.get('parentView.parentView.configs').setEach('saveRecommended', 
this.get('checked'));
+}
   })
 }),
 onPrimary: function () {



[2/2] ambari git commit: AMBARI-11947. ambari-agent 2.0.1 overwrites /etc/sudoers.d/ambar-agent if it is exists (aonishuk)

2015-06-16 Thread aonishuk
AMBARI-11947.  ambari-agent 2.0.1 overwrites /etc/sudoers.d/ambar-agent if it 
is exists  (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: 8cf944bbfdc628e0d849b414c1cb4c121e568281
Parents: 98c5445
Author: Andrew Onishuk aonis...@hortonworks.com
Authored: Tue Jun 16 16:48:05 2015 +0300
Committer: Andrew Onishuk aonis...@hortonworks.com
Committed: Tue Jun 16 16:48:05 2015 +0300

--
 ambari-agent/conf/unix/install-helper.sh |  8 
 ambari-agent/etc/sudoers.d/ambari-agent  |  1 -
 ambari-agent/pom.xml | 23 ---
 3 files changed, 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8cf944bb/ambari-agent/conf/unix/install-helper.sh
--
diff --git a/ambari-agent/conf/unix/install-helper.sh 
b/ambari-agent/conf/unix/install-helper.sh
index 5552d3c..48391d5 100644
--- a/ambari-agent/conf/unix/install-helper.sh
+++ b/ambari-agent/conf/unix/install-helper.sh
@@ -31,7 +31,6 @@ 
SIMPLEJSON_AGENT_DIR=/usr/lib/ambari-agent/lib/ambari_simplejson
 
 PYTHON_WRAPER_TARGET=/usr/bin/ambari-python-wrap
 PYTHON_WRAPER_SOURCE=/var/lib/ambari-agent/ambari-python-wrap
-SUDOERS_FILE=/etc/sudoers.d/ambari-agent
 
 do_install(){
   # setting ambari_commons shared resource
@@ -56,13 +55,6 @@ do_install(){
 ln -s $PYTHON_WRAPER_SOURCE $PYTHON_WRAPER_TARGET
   fi
   
-  chmod 440 $SUDOERS_FILE
-  
-  grep '^#includedir /etc/sudoers.d$' /etc/sudoers  /dev/null
-  if [ $? -ne 0 ] ; then
-echo '#includedir /etc/sudoers.d'  /etc/sudoers
-  fi
-  
   # on nano Ubuntu, when umask=027 those folders are created without 'x' bit 
for 'others'.
   # which causes failures when hadoop users try to access tmp_dir
   chmod a+x /var/lib/ambari-agent

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cf944bb/ambari-agent/etc/sudoers.d/ambari-agent
--
diff --git a/ambari-agent/etc/sudoers.d/ambari-agent 
b/ambari-agent/etc/sudoers.d/ambari-agent
deleted file mode 100644
index 1663152..000
--- a/ambari-agent/etc/sudoers.d/ambari-agent
+++ /dev/null
@@ -1 +0,0 @@
-Defaults:root !requiretty

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cf944bb/ambari-agent/pom.xml
--
diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index b2690b0..7ce2438 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -51,7 +51,6 @@
 target.cache.dir${project.build.directory}/cache//target.cache.dir
 
resource.keeper.script${ambari.server.module}/src/main/python/ambari_server/resourceFilesKeeper.py/resource.keeper.script
 init.d.dir/etc/rc.d/init.d/init.d.dir
-sudoers.d.dir/etc/sudoers.d/sudoers.d.dir
   /properties
   build
 plugins
@@ -417,17 +416,6 @@
   /sources
 /mapping
 mapping
-  directory${sudoers.d.dir}/directory
-  usernameroot/username
-  groupnameroot/groupname
-  directoryIncludedfalse/directoryIncluded
-  sources
-source
-  locationetc/sudoers.d/location
-/source
-  /sources
-/mapping
-mapping
   directory/var/lib/${project.artifactId}/data/directory
   filemode755/filemode
   usernameroot/username
@@ -540,16 +528,6 @@
   grouproot/group
   filemode755/filemode
   /mapper
-/data
-   data
-  srcetc/sudoers.d/ambari-agent/src
-  typefile/type
-  mapper
-typeperm/type
-prefix${sudoers.d.dir}/prefix
-  userroot/user
-  grouproot/group
-  /mapper
 /data
 data
   src${basedir}/target/src/ambari-agent/src
@@ -765,7 +743,6 @@
 excludesrc/test/python/ambari_agent/dummy*.txt/exclude
 excludesrc/main/python/ambari_agent/imports.txt/exclude
 excludesrc/main/python/ambari_agent/apscheduler/**/exclude
-excludeetc/sudoers.d/ambari-agent/exclude
 exclude**/*.erb/exclude
 exclude**/*.json/exclude
 exclude**/*.pydevproject/exclude



[1/2] ambari git commit: AMBARI-11947. ambari-agent 2.0.1 overwrites /etc/sudoers.d/ambar-agent if it is exists (aonishuk)

2015-06-16 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 98c54452d - 8cf944bbf
  refs/heads/trunk adbfdb805 - 058983f10


AMBARI-11947.  ambari-agent 2.0.1 overwrites /etc/sudoers.d/ambar-agent if it 
is exists  (aonishuk)


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

Branch: refs/heads/trunk
Commit: 058983f10ffcd2c87d805c4bd8118a94ee5187d7
Parents: adbfdb8
Author: Andrew Onishuk aonis...@hortonworks.com
Authored: Tue Jun 16 16:48:02 2015 +0300
Committer: Andrew Onishuk aonis...@hortonworks.com
Committed: Tue Jun 16 16:48:02 2015 +0300

--
 ambari-agent/conf/unix/install-helper.sh |  8 
 ambari-agent/etc/sudoers.d/ambari-agent  |  1 -
 ambari-agent/pom.xml | 23 ---
 3 files changed, 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/058983f1/ambari-agent/conf/unix/install-helper.sh
--
diff --git a/ambari-agent/conf/unix/install-helper.sh 
b/ambari-agent/conf/unix/install-helper.sh
index 5552d3c..48391d5 100644
--- a/ambari-agent/conf/unix/install-helper.sh
+++ b/ambari-agent/conf/unix/install-helper.sh
@@ -31,7 +31,6 @@ 
SIMPLEJSON_AGENT_DIR=/usr/lib/ambari-agent/lib/ambari_simplejson
 
 PYTHON_WRAPER_TARGET=/usr/bin/ambari-python-wrap
 PYTHON_WRAPER_SOURCE=/var/lib/ambari-agent/ambari-python-wrap
-SUDOERS_FILE=/etc/sudoers.d/ambari-agent
 
 do_install(){
   # setting ambari_commons shared resource
@@ -56,13 +55,6 @@ do_install(){
 ln -s $PYTHON_WRAPER_SOURCE $PYTHON_WRAPER_TARGET
   fi
   
-  chmod 440 $SUDOERS_FILE
-  
-  grep '^#includedir /etc/sudoers.d$' /etc/sudoers  /dev/null
-  if [ $? -ne 0 ] ; then
-echo '#includedir /etc/sudoers.d'  /etc/sudoers
-  fi
-  
   # on nano Ubuntu, when umask=027 those folders are created without 'x' bit 
for 'others'.
   # which causes failures when hadoop users try to access tmp_dir
   chmod a+x /var/lib/ambari-agent

http://git-wip-us.apache.org/repos/asf/ambari/blob/058983f1/ambari-agent/etc/sudoers.d/ambari-agent
--
diff --git a/ambari-agent/etc/sudoers.d/ambari-agent 
b/ambari-agent/etc/sudoers.d/ambari-agent
deleted file mode 100644
index 1663152..000
--- a/ambari-agent/etc/sudoers.d/ambari-agent
+++ /dev/null
@@ -1 +0,0 @@
-Defaults:root !requiretty

http://git-wip-us.apache.org/repos/asf/ambari/blob/058983f1/ambari-agent/pom.xml
--
diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index 12e6719..0dedc8d 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -51,7 +51,6 @@
 target.cache.dir${project.build.directory}/cache//target.cache.dir
 
resource.keeper.script${ambari.server.module}/src/main/python/ambari_server/resourceFilesKeeper.py/resource.keeper.script
 init.d.dir/etc/rc.d/init.d/init.d.dir
-sudoers.d.dir/etc/sudoers.d/sudoers.d.dir
   /properties
   build
 plugins
@@ -417,17 +416,6 @@
   /sources
 /mapping
 mapping
-  directory${sudoers.d.dir}/directory
-  usernameroot/username
-  groupnameroot/groupname
-  directoryIncludedfalse/directoryIncluded
-  sources
-source
-  locationetc/sudoers.d/location
-/source
-  /sources
-/mapping
-mapping
   directory/var/lib/${project.artifactId}/data/directory
   filemode755/filemode
   usernameroot/username
@@ -540,16 +528,6 @@
   grouproot/group
   filemode755/filemode
   /mapper
-/data
-   data
-  srcetc/sudoers.d/ambari-agent/src
-  typefile/type
-  mapper
-typeperm/type
-prefix${sudoers.d.dir}/prefix
-  userroot/user
-  grouproot/group
-  /mapper
 /data
 data
   src${basedir}/target/src/ambari-agent/src
@@ -765,7 +743,6 @@
 excludesrc/test/python/ambari_agent/dummy*.txt/exclude
 excludesrc/main/python/ambari_agent/imports.txt/exclude
 excludesrc/main/python/ambari_agent/apscheduler/**/exclude
-excludeetc/sudoers.d/ambari-agent/exclude
 exclude**/*.erb/exclude
 exclude**/*.json/exclude
 exclude**/*.pydevproject/exclude



ambari git commit: AMBARI-11939 - Upgrades Placed Into ABORTED Status Show As COMPLETED (jonathanhurley)

2015-06-16 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk f84ef816c - d13f7098b


AMBARI-11939 - Upgrades Placed Into ABORTED Status Show As COMPLETED 
(jonathanhurley)


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

Branch: refs/heads/trunk
Commit: d13f7098b3bd220413bd13534877383e0bfe66a2
Parents: f84ef81
Author: Jonathan Hurley jhur...@hortonworks.com
Authored: Mon Jun 15 21:27:48 2015 -0400
Committer: Jonathan Hurley jhur...@hortonworks.com
Committed: Tue Jun 16 08:16:15 2015 -0400

--
 .../controller/internal/CalculatedStatus.java   |  6 +-
 .../internal/CalculatedStatusTest.java  | 59 +++-
 2 files changed, 46 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d13f7098/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
index 34fed41..55d91c7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
@@ -337,15 +337,13 @@ public class CalculatedStatus {
* @return summary request status based on statuses of tasks in different 
states.
*/
   private static HostRoleStatus calculateSummaryStatus(MapHostRoleStatus, 
Integer counters,
-  int total,
-  boolean skippable) {
-
+  int total, boolean skippable) {
 return counters.get(HostRoleStatus.PENDING) == total ? 
HostRoleStatus.PENDING :
 counters.get(HostRoleStatus.HOLDING)  0 ? HostRoleStatus.HOLDING :
 counters.get(HostRoleStatus.HOLDING_FAILED)  0 ? 
HostRoleStatus.HOLDING_FAILED :
 counters.get(HostRoleStatus.HOLDING_TIMEDOUT)  0 ? 
HostRoleStatus.HOLDING_TIMEDOUT :
 counters.get(HostRoleStatus.FAILED)  0  !skippable ? 
HostRoleStatus.FAILED :
-counters.get(HostRoleStatus.ABORTED)  0  !skippable ? 
HostRoleStatus.ABORTED :
+counters.get(HostRoleStatus.ABORTED)  0 ? HostRoleStatus.ABORTED:
 counters.get(HostRoleStatus.TIMEDOUT)  0  !skippable ? 
HostRoleStatus.TIMEDOUT :
 counters.get(HostRoleStatus.COMPLETED) == total ? 
HostRoleStatus.COMPLETED : HostRoleStatus.IN_PROGRESS;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/d13f7098/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
index 79674cb..4700202 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
@@ -27,16 +27,12 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
-import com.google.inject.Guice;
-import com.google.inject.Inject;
-import com.google.inject.Injector;
 import org.apache.ambari.server.Role;
 import org.apache.ambari.server.RoleCommand;
 import org.apache.ambari.server.actionmanager.HostRoleCommand;
 import org.apache.ambari.server.actionmanager.HostRoleCommandFactory;
 import org.apache.ambari.server.actionmanager.HostRoleStatus;
 import org.apache.ambari.server.actionmanager.Stage;
-import org.apache.ambari.server.actionmanager.StageFactory;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 import org.apache.ambari.server.orm.entities.HostRoleCommandEntity;
@@ -44,6 +40,10 @@ import org.apache.ambari.server.orm.entities.StageEntity;
 import org.junit.Before;
 import org.junit.Test;
 
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+
 /**
  * CalculatedStatus tests.
  */
@@ -95,8 +95,6 @@ public class CalculatedStatusTest {
 
   @Test
   public void testStatusFromTaskEntities() throws Exception {
-
-
 // Pending stage
 CollectionHostRoleCommandEntity tasks =
 getTaskEntities(HostRoleStatus.PENDING, HostRoleStatus.PENDING, 
HostRoleStatus.PENDING, 

[2/2] ambari git commit: AMBARI-11902. Oozie Server Status alert fails in a SSL enabled Oozie environment (dlysnichenko)

2015-06-16 Thread dmitriusan
AMBARI-11902. Oozie Server Status alert fails in a SSL enabled Oozie 
environment (dlysnichenko)


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

Branch: refs/heads/branch-2.1
Commit: 98c54452da7e15f74face37c49d10995c7e99fdc
Parents: 48da3d2
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Jun 16 16:16:11 2015 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Jun 16 16:16:48 2015 +0300

--
 .../package/alerts/alert_check_oozie_server.py  | 37 ++--
 1 file changed, 34 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/98c54452/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
index 3671ffc..cc4d52b 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
@@ -25,13 +25,19 @@ from resource_management.libraries.functions import 
get_kinit_path
 from resource_management.libraries.functions import get_klist_path
 from ambari_commons.os_check import OSConst, OSCheck
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
-import os
 from urlparse import urlparse
+import os
+import re
 
 RESULT_CODE_OK = 'OK'
 RESULT_CODE_CRITICAL = 'CRITICAL'
 RESULT_CODE_UNKNOWN = 'UNKNOWN'
 
+if OSCheck.is_windows_family():
+  OOZIE_ENV_HTTPS_RE = rset\s+OOZIE_HTTPS_PORT=(\d+)
+else:
+  OOZIE_ENV_HTTPS_RE = rexport\s+OOZIE_HTTPS_PORT=(\d+)
+
 # The configured Kerberos executable search paths, if any
 KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY = 
'{{kerberos-env/executable_search_paths}}'
 
@@ -42,6 +48,8 @@ OOZIE_KEYTAB = 
'{{oozie-site/oozie.authentication.kerberos.keytab}}'
 OOZIE_USER = '{{oozie-env/oozie_user}}'
 OOZIE_CONF_DIR = '/usr/hdp/current/oozie-server/conf'
 OOZIE_CONF_DIR_LEGACY = '/etc/oozie/conf'
+OOZIE_HTTPS_PORT = '{{oozie-site/oozie.https.port}}'
+OOZIE_ENV_CONTENT = '{{oozie-env/content}}'
 
 class KerberosPropertiesNotFound(Exception): pass
 
@@ -59,7 +67,8 @@ def get_tokens():
   Returns a tuple of tokens in the format {{site/property}} that will be used
   to build the dictionary passed into execute
   
-  return (OOZIE_URL_KEY, OOZIE_PRINCIPAL, SECURITY_ENABLED, OOZIE_KEYTAB, 
KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY, OOZIE_USER)
+  return (OOZIE_URL_KEY, OOZIE_PRINCIPAL, SECURITY_ENABLED, OOZIE_KEYTAB, 
KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY,
+  OOZIE_USER, OOZIE_HTTPS_PORT, OOZIE_ENV_CONTENT)
 
 @OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY)
 def get_check_command(oozie_url, host_name, configurations):
@@ -150,8 +159,30 @@ def execute(configurations={}, parameters={}, 
host_name=None):
   # interfaces, which doesn't work on Windows
   localhost_address = 'localhost' if OSCheck.get_os_family() == 
OSConst.WINSRV_FAMILY else '0.0.0.0'
 
+  https_port = None
+  # try to get https port form oozie-env content
+  if OOZIE_ENV_CONTENT in configurations:
+for line in configurations[OOZIE_ENV_CONTENT].splitlines():
+  result = re.match(OOZIE_ENV_HTTPS_RE, line)
+
+  if result is not None:
+https_port = result.group(1)
+  # or from oozie-site.xml
+  if https_port is None and OOZIE_HTTPS_PORT in configurations:
+https_port = configurations[OOZIE_HTTPS_PORT]
+
   oozie_url = configurations[OOZIE_URL_KEY]
-  oozie_url = oozie_url.replace(urlparse(oozie_url).hostname,localhost_address)
+
+  # construct proper url for https
+  if https_port is not None:
+parsed_url = urlparse(oozie_url)
+oozie_url = oozie_url.replace(parsed_url.scheme, https)
+if parsed_url.port is None:
+  oozie_url.replace(parsed_url.hostname, :.join([parsed_url.hostname, 
https_port]))
+else:
+  oozie_url = oozie_url.replace(str(parsed_url.port), https_port)
+
+  oozie_url = oozie_url.replace(urlparse(oozie_url).hostname, 
localhost_address)
 
   try:
 command, env, oozie_user = get_check_command(oozie_url, host_name, 
configurations)



[1/2] ambari git commit: AMBARI-11902. Oozie Server Status alert fails in a SSL enabled Oozie environment (dlysnichenko)

2015-06-16 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 48da3d273 - 98c54452d
  refs/heads/trunk 7b031f9e0 - adbfdb805


AMBARI-11902. Oozie Server Status alert fails in a SSL enabled Oozie 
environment (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: adbfdb8050fc5ca9f96f921a278f99cdb0d56424
Parents: 7b031f9
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Jun 16 16:16:11 2015 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Jun 16 16:16:11 2015 +0300

--
 .../package/alerts/alert_check_oozie_server.py  | 37 ++--
 1 file changed, 34 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/adbfdb80/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
index 3671ffc..cc4d52b 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
+++ 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
@@ -25,13 +25,19 @@ from resource_management.libraries.functions import 
get_kinit_path
 from resource_management.libraries.functions import get_klist_path
 from ambari_commons.os_check import OSConst, OSCheck
 from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
-import os
 from urlparse import urlparse
+import os
+import re
 
 RESULT_CODE_OK = 'OK'
 RESULT_CODE_CRITICAL = 'CRITICAL'
 RESULT_CODE_UNKNOWN = 'UNKNOWN'
 
+if OSCheck.is_windows_family():
+  OOZIE_ENV_HTTPS_RE = rset\s+OOZIE_HTTPS_PORT=(\d+)
+else:
+  OOZIE_ENV_HTTPS_RE = rexport\s+OOZIE_HTTPS_PORT=(\d+)
+
 # The configured Kerberos executable search paths, if any
 KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY = 
'{{kerberos-env/executable_search_paths}}'
 
@@ -42,6 +48,8 @@ OOZIE_KEYTAB = 
'{{oozie-site/oozie.authentication.kerberos.keytab}}'
 OOZIE_USER = '{{oozie-env/oozie_user}}'
 OOZIE_CONF_DIR = '/usr/hdp/current/oozie-server/conf'
 OOZIE_CONF_DIR_LEGACY = '/etc/oozie/conf'
+OOZIE_HTTPS_PORT = '{{oozie-site/oozie.https.port}}'
+OOZIE_ENV_CONTENT = '{{oozie-env/content}}'
 
 class KerberosPropertiesNotFound(Exception): pass
 
@@ -59,7 +67,8 @@ def get_tokens():
   Returns a tuple of tokens in the format {{site/property}} that will be used
   to build the dictionary passed into execute
   
-  return (OOZIE_URL_KEY, OOZIE_PRINCIPAL, SECURITY_ENABLED, OOZIE_KEYTAB, 
KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY, OOZIE_USER)
+  return (OOZIE_URL_KEY, OOZIE_PRINCIPAL, SECURITY_ENABLED, OOZIE_KEYTAB, 
KERBEROS_EXECUTABLE_SEARCH_PATHS_KEY,
+  OOZIE_USER, OOZIE_HTTPS_PORT, OOZIE_ENV_CONTENT)
 
 @OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY)
 def get_check_command(oozie_url, host_name, configurations):
@@ -150,8 +159,30 @@ def execute(configurations={}, parameters={}, 
host_name=None):
   # interfaces, which doesn't work on Windows
   localhost_address = 'localhost' if OSCheck.get_os_family() == 
OSConst.WINSRV_FAMILY else '0.0.0.0'
 
+  https_port = None
+  # try to get https port form oozie-env content
+  if OOZIE_ENV_CONTENT in configurations:
+for line in configurations[OOZIE_ENV_CONTENT].splitlines():
+  result = re.match(OOZIE_ENV_HTTPS_RE, line)
+
+  if result is not None:
+https_port = result.group(1)
+  # or from oozie-site.xml
+  if https_port is None and OOZIE_HTTPS_PORT in configurations:
+https_port = configurations[OOZIE_HTTPS_PORT]
+
   oozie_url = configurations[OOZIE_URL_KEY]
-  oozie_url = oozie_url.replace(urlparse(oozie_url).hostname,localhost_address)
+
+  # construct proper url for https
+  if https_port is not None:
+parsed_url = urlparse(oozie_url)
+oozie_url = oozie_url.replace(parsed_url.scheme, https)
+if parsed_url.port is None:
+  oozie_url.replace(parsed_url.hostname, :.join([parsed_url.hostname, 
https_port]))
+else:
+  oozie_url = oozie_url.replace(str(parsed_url.port), https_port)
+
+  oozie_url = oozie_url.replace(urlparse(oozie_url).hostname, 
localhost_address)
 
   try:
 command, env, oozie_user = get_check_command(oozie_url, host_name, 
configurations)



[2/2] ambari git commit: AMBARI-11948. If couple of users have the same UID as root (or amari user) ambari-agent fails to start (aonishuk)

2015-06-16 Thread aonishuk
AMBARI-11948. If couple of users have the same UID as root (or amari user) 
ambari-agent fails to start (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: 66eecc810d34ffae6f4f60295a621589f67ae2a6
Parents: 8cf944b
Author: Andrew Onishuk aonis...@hortonworks.com
Authored: Tue Jun 16 16:57:55 2015 +0300
Committer: Andrew Onishuk aonis...@hortonworks.com
Committed: Tue Jun 16 16:57:55 2015 +0300

--
 ambari-agent/conf/unix/ambari-agent | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/66eecc81/ambari-agent/conf/unix/ambari-agent
--
diff --git a/ambari-agent/conf/unix/ambari-agent 
b/ambari-agent/conf/unix/ambari-agent
index bc61af2..2d38067 100755
--- a/ambari-agent/conf/unix/ambari-agent
+++ b/ambari-agent/conf/unix/ambari-agent
@@ -48,10 +48,10 @@ 
AMBARI_AGENT_PY_SCRIPT=/usr/lib/python2.6/site-packages/ambari_agent/AmbariAgent
 OK=1
 NOTOK=0
 
-current_user=`awk -v val=$EUID -F : '$3==val{print $1}' /etc/passwd`
+current_user=`id -u -n`
 echo  | sudo -S -l  /dev/null 21
-if [ $? != 0 ]  [ $current_user != root ] ; then
- echo You can't perform this operation as non-sudoer user. Please, re-login 
as one
+if [ $? != 0 ]  [ $EUID -ne 0 ] ; then
+ echo You can't perform this operation as non-sudoer user. Please, re-login 
or configure sudo access for this user.
  exit 0
 fi
 



[1/2] ambari git commit: AMBARI-11948. If couple of users have the same UID as root (or amari user) ambari-agent fails to start (aonishuk)

2015-06-16 Thread aonishuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 8cf944bbf - 66eecc810
  refs/heads/trunk 058983f10 - 67add3fd3


AMBARI-11948. If couple of users have the same UID as root (or amari user) 
ambari-agent fails to start (aonishuk)


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

Branch: refs/heads/trunk
Commit: 67add3fd3bd02853bb8a62cf2d6d9a0e9d4a9654
Parents: 058983f
Author: Andrew Onishuk aonis...@hortonworks.com
Authored: Tue Jun 16 16:57:52 2015 +0300
Committer: Andrew Onishuk aonis...@hortonworks.com
Committed: Tue Jun 16 16:57:52 2015 +0300

--
 ambari-agent/conf/unix/ambari-agent | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/67add3fd/ambari-agent/conf/unix/ambari-agent
--
diff --git a/ambari-agent/conf/unix/ambari-agent 
b/ambari-agent/conf/unix/ambari-agent
index bc61af2..2d38067 100755
--- a/ambari-agent/conf/unix/ambari-agent
+++ b/ambari-agent/conf/unix/ambari-agent
@@ -48,10 +48,10 @@ 
AMBARI_AGENT_PY_SCRIPT=/usr/lib/python2.6/site-packages/ambari_agent/AmbariAgent
 OK=1
 NOTOK=0
 
-current_user=`awk -v val=$EUID -F : '$3==val{print $1}' /etc/passwd`
+current_user=`id -u -n`
 echo  | sudo -S -l  /dev/null 21
-if [ $? != 0 ]  [ $current_user != root ] ; then
- echo You can't perform this operation as non-sudoer user. Please, re-login 
as one
+if [ $? != 0 ]  [ $EUID -ne 0 ] ; then
+ echo You can't perform this operation as non-sudoer user. Please, re-login 
or configure sudo access for this user.
  exit 0
 fi
 



ambari git commit: AMBARI-11939 - Upgrades Placed Into ABORTED Status Show As COMPLETED (jonathanhurley)

2015-06-16 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 a26f98821 - 9531ed270


AMBARI-11939 - Upgrades Placed Into ABORTED Status Show As COMPLETED 
(jonathanhurley)


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

Branch: refs/heads/branch-2.1
Commit: 9531ed270529373d377c2062c65ecf9f041a3fd4
Parents: a26f988
Author: Jonathan Hurley jhur...@hortonworks.com
Authored: Mon Jun 15 21:27:48 2015 -0400
Committer: Jonathan Hurley jhur...@hortonworks.com
Committed: Tue Jun 16 08:16:43 2015 -0400

--
 .../controller/internal/CalculatedStatus.java   |  6 +-
 .../internal/CalculatedStatusTest.java  | 59 +++-
 2 files changed, 46 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9531ed27/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
index 34fed41..55d91c7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/CalculatedStatus.java
@@ -337,15 +337,13 @@ public class CalculatedStatus {
* @return summary request status based on statuses of tasks in different 
states.
*/
   private static HostRoleStatus calculateSummaryStatus(MapHostRoleStatus, 
Integer counters,
-  int total,
-  boolean skippable) {
-
+  int total, boolean skippable) {
 return counters.get(HostRoleStatus.PENDING) == total ? 
HostRoleStatus.PENDING :
 counters.get(HostRoleStatus.HOLDING)  0 ? HostRoleStatus.HOLDING :
 counters.get(HostRoleStatus.HOLDING_FAILED)  0 ? 
HostRoleStatus.HOLDING_FAILED :
 counters.get(HostRoleStatus.HOLDING_TIMEDOUT)  0 ? 
HostRoleStatus.HOLDING_TIMEDOUT :
 counters.get(HostRoleStatus.FAILED)  0  !skippable ? 
HostRoleStatus.FAILED :
-counters.get(HostRoleStatus.ABORTED)  0  !skippable ? 
HostRoleStatus.ABORTED :
+counters.get(HostRoleStatus.ABORTED)  0 ? HostRoleStatus.ABORTED:
 counters.get(HostRoleStatus.TIMEDOUT)  0  !skippable ? 
HostRoleStatus.TIMEDOUT :
 counters.get(HostRoleStatus.COMPLETED) == total ? 
HostRoleStatus.COMPLETED : HostRoleStatus.IN_PROGRESS;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/9531ed27/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
index 79674cb..4700202 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/CalculatedStatusTest.java
@@ -27,16 +27,12 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
-import com.google.inject.Guice;
-import com.google.inject.Inject;
-import com.google.inject.Injector;
 import org.apache.ambari.server.Role;
 import org.apache.ambari.server.RoleCommand;
 import org.apache.ambari.server.actionmanager.HostRoleCommand;
 import org.apache.ambari.server.actionmanager.HostRoleCommandFactory;
 import org.apache.ambari.server.actionmanager.HostRoleStatus;
 import org.apache.ambari.server.actionmanager.Stage;
-import org.apache.ambari.server.actionmanager.StageFactory;
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 import org.apache.ambari.server.orm.entities.HostRoleCommandEntity;
@@ -44,6 +40,10 @@ import org.apache.ambari.server.orm.entities.StageEntity;
 import org.junit.Before;
 import org.junit.Test;
 
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+
 /**
  * CalculatedStatus tests.
  */
@@ -95,8 +95,6 @@ public class CalculatedStatusTest {
 
   @Test
   public void testStatusFromTaskEntities() throws Exception {
-
-
 // Pending stage
 CollectionHostRoleCommandEntity tasks =
 getTaskEntities(HostRoleStatus.PENDING, HostRoleStatus.PENDING, 
HostRoleStatus.PENDING, 

ambari git commit: AMBARI-11940. Automatic retry of commands should be limited to initial INSTALL and START only (smohanty)

2015-06-16 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/trunk 67add3fd3 - 222b0292e


AMBARI-11940. Automatic retry of commands should be limited to initial INSTALL 
and START only (smohanty)


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

Branch: refs/heads/trunk
Commit: 222b0292e4e22db1e2be6bd03764280b3cbce837
Parents: 67add3f
Author: Sumit Mohanty smoha...@hortonworks.com
Authored: Tue Jun 16 07:35:30 2015 -0700
Committer: Sumit Mohanty smoha...@hortonworks.com
Committed: Tue Jun 16 07:35:30 2015 -0700

--
 .../AmbariManagementControllerImpl.java |  73 +++---
 .../internal/HostComponentResourceProvider.java |   2 +
 .../AmbariManagementControllerTest.java | 233 ++-
 3 files changed, 173 insertions(+), 135 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/222b0292/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 6a3cc1c..42f4708 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
@@ -181,6 +181,10 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
*/
   private static final String REQUEST_CONTEXT_PROPERTY = context;
 
+  private static final String CLUSTER_PHASE_PROPERTY = phase;
+  private static final String CLUSTER_PHASE_INITIAL_INSTALL = 
INITIAL_INSTALL;
+  private static final String CLUSTER_PHASE_INITIAL_START = INITIAL_START;
+
   private static final String BASE_LOG_DIR = /tmp/ambari;
 
   private final Clusters clusters;
@@ -1767,7 +1771,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 MapString, MapString, MapString, String 
configurationAttributes,
 MapString, MapString, String configTags,
 RoleCommand roleCommand,
-MapString, String commandParams,
+MapString, String commandParamsInp,
 ServiceComponentHostEvent event
 )
 throws AmbariException {
@@ -1807,8 +1811,10 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 execCmd.setConfigurations(configurations);
 execCmd.setConfigurationAttributes(configurationAttributes);
 execCmd.setConfigurationTags(configTags);
-if (commandParams == null) { // if not defined
-  commandParams = new TreeMapString, String();
+// Create a local copy for each command
+MapString, String commandParams = new TreeMapString, String();
+if (commandParamsInp != null) { // if not defined
+  commandParams.putAll(commandParamsInp);
 }
 boolean isInstallCommand = roleCommand.equals(RoleCommand.INSTALL);
 String agentDefaultCommandTimeout = 
configs.getDefaultAgentTaskTimeout(isInstallCommand);
@@ -1823,38 +1829,43 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 commandParams.put(SCRIPT, script.getScript());
 commandParams.put(SCRIPT_TYPE, script.getScriptType().toString());
 
-String retryEnabledStr = 
configHelper.getValueFromDesiredConfigurations(cluster, 
ConfigHelper.CLUSTER_ENV,
-   
 ConfigHelper.CLUSTER_ENV_RETRY_ENABLED);
-String commandsStr = 
configHelper.getValueFromDesiredConfigurations(cluster, 
ConfigHelper.CLUSTER_ENV,
-
ConfigHelper.CLUSTER_ENV_RETRY_COMMANDS);
-String retryMaxTimeStr = 
configHelper.getValueFromDesiredConfigurations(cluster, 
ConfigHelper.CLUSTER_ENV,
-
ConfigHelper.CLUSTER_ENV_RETRY_MAX_TIME_IN_SEC);
-
 boolean retryEnabled = false;
-if(StringUtils.isNotEmpty(retryEnabledStr)) {
-  retryEnabled = Boolean.TRUE.toString().equals(retryEnabledStr);
-}
-
 Integer retryMaxTime = 0;
-
-if (retryEnabled) {
-  retryMaxTime = NumberUtils.toInt(retryMaxTimeStr, 0);
-  if(retryMaxTime  

ambari git commit: AMBARI-11940. Automatic retry of commands should be limited to initial INSTALL and START only (smohanty)

2015-06-16 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 66eecc810 - 0f86b97a5


AMBARI-11940. Automatic retry of commands should be limited to initial INSTALL 
and START only (smohanty)


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

Branch: refs/heads/branch-2.1
Commit: 0f86b97a5afd3fd4b161a24c844bf759c05aa5da
Parents: 66eecc8
Author: Sumit Mohanty smoha...@hortonworks.com
Authored: Tue Jun 16 07:35:30 2015 -0700
Committer: Sumit Mohanty smoha...@hortonworks.com
Committed: Tue Jun 16 07:36:18 2015 -0700

--
 .../AmbariManagementControllerImpl.java |  73 +++---
 .../internal/HostComponentResourceProvider.java |   2 +
 .../AmbariManagementControllerTest.java | 233 ++-
 3 files changed, 173 insertions(+), 135 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0f86b97a/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 6a3cc1c..42f4708 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
@@ -181,6 +181,10 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
*/
   private static final String REQUEST_CONTEXT_PROPERTY = context;
 
+  private static final String CLUSTER_PHASE_PROPERTY = phase;
+  private static final String CLUSTER_PHASE_INITIAL_INSTALL = 
INITIAL_INSTALL;
+  private static final String CLUSTER_PHASE_INITIAL_START = INITIAL_START;
+
   private static final String BASE_LOG_DIR = /tmp/ambari;
 
   private final Clusters clusters;
@@ -1767,7 +1771,7 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 MapString, MapString, MapString, String 
configurationAttributes,
 MapString, MapString, String configTags,
 RoleCommand roleCommand,
-MapString, String commandParams,
+MapString, String commandParamsInp,
 ServiceComponentHostEvent event
 )
 throws AmbariException {
@@ -1807,8 +1811,10 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 execCmd.setConfigurations(configurations);
 execCmd.setConfigurationAttributes(configurationAttributes);
 execCmd.setConfigurationTags(configTags);
-if (commandParams == null) { // if not defined
-  commandParams = new TreeMapString, String();
+// Create a local copy for each command
+MapString, String commandParams = new TreeMapString, String();
+if (commandParamsInp != null) { // if not defined
+  commandParams.putAll(commandParamsInp);
 }
 boolean isInstallCommand = roleCommand.equals(RoleCommand.INSTALL);
 String agentDefaultCommandTimeout = 
configs.getDefaultAgentTaskTimeout(isInstallCommand);
@@ -1823,38 +1829,43 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
 commandParams.put(SCRIPT, script.getScript());
 commandParams.put(SCRIPT_TYPE, script.getScriptType().toString());
 
-String retryEnabledStr = 
configHelper.getValueFromDesiredConfigurations(cluster, 
ConfigHelper.CLUSTER_ENV,
-   
 ConfigHelper.CLUSTER_ENV_RETRY_ENABLED);
-String commandsStr = 
configHelper.getValueFromDesiredConfigurations(cluster, 
ConfigHelper.CLUSTER_ENV,
-
ConfigHelper.CLUSTER_ENV_RETRY_COMMANDS);
-String retryMaxTimeStr = 
configHelper.getValueFromDesiredConfigurations(cluster, 
ConfigHelper.CLUSTER_ENV,
-
ConfigHelper.CLUSTER_ENV_RETRY_MAX_TIME_IN_SEC);
-
 boolean retryEnabled = false;
-if(StringUtils.isNotEmpty(retryEnabledStr)) {
-  retryEnabled = Boolean.TRUE.toString().equals(retryEnabledStr);
-}
-
 Integer retryMaxTime = 0;
-
-if (retryEnabled) {
-  retryMaxTime = NumberUtils.toInt(retryMaxTimeStr, 0);
-  

ambari git commit: AMBARI-11946 Set right boolean property for Kafka (HDP 2.2) in kafka-env (Gautam Borad via jluniya)

2015-06-16 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 22bfe3917 - 8a211325e


AMBARI-11946 Set right boolean property for Kafka (HDP 2.2) in kafka-env 
(Gautam Borad via jluniya)


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

Branch: refs/heads/branch-2.1
Commit: 8a211325e730cf25ec8c0f8adb090fb60ca8aecd
Parents: 22bfe39
Author: Jayush Luniya jlun...@hortonworks.com
Authored: Tue Jun 16 11:45:33 2015 -0700
Committer: Jayush Luniya jlun...@hortonworks.com
Committed: Tue Jun 16 11:46:44 2015 -0700

--
 .../common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml   | 2 +-
 .../common-services/KAFKA/0.8.1.2.2/package/scripts/params.py | 3 ++-
 .../stacks/HDP/2.3/services/KAFKA/configuration/kafka-env.xml | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8a211325/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
 
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
index 132e641..94f4975 100644
--- 
a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
+++ 
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
@@ -65,6 +65,6 @@ fi
   /property
   property
 nameis_supported_kafka_ranger/name
-valueFalse/value
+valuefalse/value
   /property
 /configuration

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a211325/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
index 708e7cd..4783b69 100644
--- 
a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
@@ -23,6 +23,7 @@ from resource_management.libraries.functions.version import 
format_hdp_stack_ver
 from resource_management.libraries.functions.default import default
 from utils import get_bare_principal
 from resource_management.libraries.functions.get_hdp_version import 
get_hdp_version
+from resource_management.libraries.functions.is_empty import is_empty
 
 import status_params
 
@@ -133,7 +134,7 @@ is_supported_kafka_ranger = 
config['configurations']['kafka-env']['is_supported_
 if has_ranger_admin and is_supported_kafka_ranger:
 
   enable_ranger_kafka = 
config['configurations']['ranger-kafka-plugin-properties']['ranger-kafka-plugin-enabled']
-  enable_ranger_kafka = enable_ranger_kafka is not None and 
enable_ranger_kafka.lower() == 'yes'
+  enable_ranger_kafka = not is_empty(enable_ranger_kafka) and 
enable_ranger_kafka.lower() == 'yes'
   policymgr_mgr_url = 
config['configurations']['admin-properties']['policymgr_external_url']
   sql_connector_jar = 
config['configurations']['admin-properties']['SQL_CONNECTOR_JAR']
   xa_audit_db_flavor = 
config['configurations']['admin-properties']['DB_FLAVOR']

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a211325/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/kafka-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/kafka-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/kafka-env.xml
index bfe2e75..eb8b78b 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/kafka-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/kafka-env.xml
@@ -23,6 +23,6 @@
 configuration
   property
 nameis_supported_kafka_ranger/name
-valueTrue/value
+valuetrue/value
   /property
 /configuration



ambari git commit: AMBARI-11444-2. Number Widgets: Empty threshold for 'Critical' still shows the value as Critical.(XIWANG)

2015-06-16 Thread xiwang
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 7e7a109d5 - 54607e874


AMBARI-11444-2. Number Widgets: Empty threshold for 'Critical' still shows the 
value as Critical.(XIWANG)


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

Branch: refs/heads/branch-2.1
Commit: 54607e874bf45bdfe0fe0a561129275b61482224
Parents: 7e7a109
Author: Xi Wang xiw...@apache.org
Authored: Mon Jun 15 15:25:48 2015 -0700
Committer: Xi Wang xiw...@apache.org
Committed: Tue Jun 16 11:24:02 2015 -0700

--
 ambari-web/app/assets/test/tests.js |   2 +
 .../views/common/widget/gauge_widget_view.js|   4 +-
 .../views/common/widget/number_widget_view.js   |   2 +-
 .../common/widget/gauge_widget_view_test.js | 166 
 .../common/widget/number_widget_view_test.js| 190 +++
 5 files changed, 361 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/54607e87/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 7b894b7..f832a48 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -191,6 +191,8 @@ var files = ['test/init_model_test',
   'test/views/common/custom_date_popup_test',
   'test/views/common/progress_bar_view_test',
   'test/views/common/widget/graph_widget_view_test',
+  'test/views/common/widget/number_widget_view_test',
+  'test/views/common/widget/gauge_widget_view_test',
   'test/views/common/modal_popups/hosts_table_list_popup_test',
   'test/views/main/admin_test',
   'test/views/main/dashboard_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/54607e87/ambari-web/app/views/common/widget/gauge_widget_view.js
--
diff --git a/ambari-web/app/views/common/widget/gauge_widget_view.js 
b/ambari-web/app/views/common/widget/gauge_widget_view.js
index 3d782cd..a1cd24b 100644
--- a/ambari-web/app/views/common/widget/gauge_widget_view.js
+++ b/ambari-web/app/views/common/widget/gauge_widget_view.js
@@ -91,12 +91,12 @@ App.GaugeWidgetView = Em.View.extend(App.WidgetMixin, {
   var color_green = App.healthStatusGreen;
   var color_red = App.healthStatusRed;
   var color_orange = App.healthStatusOrange;
-  if (isNaN(threshold1) || (isNaN(threshold2)  used = threshold1) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (used  threshold1)) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (used = threshold1))) {
+  if ((isNaN(threshold1)  isNaN(threshold2)) || (isNaN(threshold1)  
used = threshold2) || (isNaN(threshold2)  used = threshold1) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (used  threshold1)) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (used = threshold1))) {
 this.set('palette', new Rickshaw.Color.Palette({
   scheme: [ '#FF', color_green  ].reverse()
 }));
 return color_green;
-  } else if ((!isNaN(threshold2)  used.isInRange(threshold1, 
threshold2)) || (isNaN(threshold2)  used  threshold1) ) {
+  } else if ((!isNaN(threshold2)  used.isInRange(threshold1, 
threshold2)) || (isNaN(threshold2)  used  threshold1)) {
 this.set('palette', new Rickshaw.Color.Palette({
   scheme: [ '#FF', color_orange  ].reverse()
 }));

http://git-wip-us.apache.org/repos/asf/ambari/blob/54607e87/ambari-web/app/views/common/widget/number_widget_view.js
--
diff --git a/ambari-web/app/views/common/widget/number_widget_view.js 
b/ambari-web/app/views/common/widget/number_widget_view.js
index 33bf34e..b962851 100644
--- a/ambari-web/app/views/common/widget/number_widget_view.js
+++ b/ambari-web/app/views/common/widget/number_widget_view.js
@@ -52,7 +52,7 @@ App.NumberWidgetView = Em.View.extend(App.WidgetMixin, {
 
 if (isNaN(value)) {
   return 'grey';
-} else if (isNaN(threshold1) || (isNaN(threshold2)  value = threshold1) 
|| (!isNaN(threshold2)  (threshold1  threshold2)  (value  threshold1)) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (value = threshold1))) {
+} else if ((isNaN(threshold1)  isNaN(threshold2)) || (isNaN(threshold1) 
 value = threshold2) || (isNaN(threshold2)  value = threshold1) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (value  threshold1)) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (value = threshold1))) {
   return 'green';
 } else if ((!isNaN(threshold2)  value.isInRange(threshold1, threshold2)) 
|| 

ambari git commit: AMBARI-11946 Set right boolean property for Kafka (HDP 2.2) in kafka-env (Gautam Borad via jluniya)

2015-06-16 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/trunk 8c92ed631 - 8d98d9307


AMBARI-11946 Set right boolean property for Kafka (HDP 2.2) in kafka-env 
(Gautam Borad via jluniya)


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

Branch: refs/heads/trunk
Commit: 8d98d930743b78006ca11eb283fcf49450c1042a
Parents: 8c92ed6
Author: Jayush Luniya jlun...@hortonworks.com
Authored: Tue Jun 16 11:45:33 2015 -0700
Committer: Jayush Luniya jlun...@hortonworks.com
Committed: Tue Jun 16 11:45:33 2015 -0700

--
 .../common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml   | 2 +-
 .../common-services/KAFKA/0.8.1.2.2/package/scripts/params.py | 3 ++-
 .../stacks/HDP/2.3/services/KAFKA/configuration/kafka-env.xml | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8d98d930/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
--
diff --git 
a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
 
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
index 132e641..94f4975 100644
--- 
a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
+++ 
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/configuration/kafka-env.xml
@@ -65,6 +65,6 @@ fi
   /property
   property
 nameis_supported_kafka_ranger/name
-valueFalse/value
+valuefalse/value
   /property
 /configuration

http://git-wip-us.apache.org/repos/asf/ambari/blob/8d98d930/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
index 708e7cd..4783b69 100644
--- 
a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1.2.2/package/scripts/params.py
@@ -23,6 +23,7 @@ from resource_management.libraries.functions.version import 
format_hdp_stack_ver
 from resource_management.libraries.functions.default import default
 from utils import get_bare_principal
 from resource_management.libraries.functions.get_hdp_version import 
get_hdp_version
+from resource_management.libraries.functions.is_empty import is_empty
 
 import status_params
 
@@ -133,7 +134,7 @@ is_supported_kafka_ranger = 
config['configurations']['kafka-env']['is_supported_
 if has_ranger_admin and is_supported_kafka_ranger:
 
   enable_ranger_kafka = 
config['configurations']['ranger-kafka-plugin-properties']['ranger-kafka-plugin-enabled']
-  enable_ranger_kafka = enable_ranger_kafka is not None and 
enable_ranger_kafka.lower() == 'yes'
+  enable_ranger_kafka = not is_empty(enable_ranger_kafka) and 
enable_ranger_kafka.lower() == 'yes'
   policymgr_mgr_url = 
config['configurations']['admin-properties']['policymgr_external_url']
   sql_connector_jar = 
config['configurations']['admin-properties']['SQL_CONNECTOR_JAR']
   xa_audit_db_flavor = 
config['configurations']['admin-properties']['DB_FLAVOR']

http://git-wip-us.apache.org/repos/asf/ambari/blob/8d98d930/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/kafka-env.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/kafka-env.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/kafka-env.xml
index bfe2e75..eb8b78b 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/kafka-env.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/kafka-env.xml
@@ -23,6 +23,6 @@
 configuration
   property
 nameis_supported_kafka_ranger/name
-valueTrue/value
+valuetrue/value
   /property
 /configuration



[2/2] ambari git commit: AMBARI-11955. After installing new repo version, some packages are installed from non-current repository under Centos 6 (dlysnichenko)

2015-06-16 Thread dmitriusan
AMBARI-11955. After installing new repo version, some packages are installed 
from non-current repository under Centos 6 (dlysnichenko)


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

Branch: refs/heads/branch-2.1
Commit: 7e7a109d55075a84f5130623cc24c4d32905529f
Parents: 0f86b97
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Jun 16 20:31:25 2015 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Jun 16 20:32:12 2015 +0300

--
 .../stacks/HDP/2.3/services/PIG/metainfo.xml  | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7e7a109d/ambari-server/src/main/resources/stacks/HDP/2.3/services/PIG/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/PIG/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/PIG/metainfo.xml
index 515f6fe..8ba2426 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/PIG/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/PIG/metainfo.xml
@@ -23,19 +23,14 @@
   version0.15.0.2.3/version
   osSpecifics
 osSpecific
-  osFamilyany/osFamily
-  packages
-package
-  namedatafu/name
-/package
-  /packages
-/osSpecific
-osSpecific
   osFamilyredhat7,redhat6,suse11/osFamily
   packages
 package
   namepig_2_3_*/name
 /package
+package
+  namedatafu_2_3_*/name
+/package
   /packages
 /osSpecific
 osSpecific
@@ -44,6 +39,9 @@
 package
   namepig-2-3-.*/name
 /package
+package
+  namedatafu-2-3-.*/name
+/package
   /packages
 /osSpecific
   /osSpecifics



[1/2] ambari git commit: AMBARI-11955. After installing new repo version, some packages are installed from non-current repository under Centos 6 (dlysnichenko)

2015-06-16 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 0f86b97a5 - 7e7a109d5
  refs/heads/trunk 222b0292e - 3e4ac6e7a


AMBARI-11955. After installing new repo version, some packages are installed 
from non-current repository under Centos 6 (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 3e4ac6e7a8014e0266598d9ccac6f4879b38f6f8
Parents: 222b029
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Jun 16 20:31:25 2015 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Jun 16 20:31:25 2015 +0300

--
 .../stacks/HDP/2.3/services/PIG/metainfo.xml  | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3e4ac6e7/ambari-server/src/main/resources/stacks/HDP/2.3/services/PIG/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/PIG/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/PIG/metainfo.xml
index 515f6fe..8ba2426 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/PIG/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/PIG/metainfo.xml
@@ -23,19 +23,14 @@
   version0.15.0.2.3/version
   osSpecifics
 osSpecific
-  osFamilyany/osFamily
-  packages
-package
-  namedatafu/name
-/package
-  /packages
-/osSpecific
-osSpecific
   osFamilyredhat7,redhat6,suse11/osFamily
   packages
 package
   namepig_2_3_*/name
 /package
+package
+  namedatafu_2_3_*/name
+/package
   /packages
 /osSpecific
 osSpecific
@@ -44,6 +39,9 @@
 package
   namepig-2-3-.*/name
 /package
+package
+  namedatafu-2-3-.*/name
+/package
   /packages
 /osSpecific
   /osSpecifics



ambari git commit: AMBARI-11950. Cannot reinstall components that are in INSTALL_FAILED state via API (ncole)

2015-06-16 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/trunk e7a8b35d6 - 8c92ed631


AMBARI-11950. Cannot reinstall components that are in INSTALL_FAILED state via 
API (ncole)


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

Branch: refs/heads/trunk
Commit: 8c92ed631f11f534d6b7de0a5b8f2f89699ebb00
Parents: e7a8b35
Author: Nate Cole nc...@hortonworks.com
Authored: Tue Jun 16 10:17:50 2015 -0400
Committer: Nate Cole nc...@hortonworks.com
Committed: Tue Jun 16 14:32:19 2015 -0400

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/8c92ed63/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
index aae3ca5..d7fc33b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java
@@ -205,7 +205,7 @@ public class HostComponentResourceProvider extends 
AbstractControllerResourcePro
 final SetServiceComponentHostRequest requests = new 
HashSetServiceComponentHostRequest();
 
 for (MapString, Object propertyMap : getPropertyMaps(predicate)) {
-  requests.add(changeRequest(propertyMap));
+  requests.add(getRequest(propertyMap));
 }
 
 return findResources(request, predicate, requests);



ambari git commit: AMBARI-11444-2. Number Widgets: Empty threshold for 'Critical' still shows the value as Critical.(XIWANG)

2015-06-16 Thread xiwang
Repository: ambari
Updated Branches:
  refs/heads/trunk 3e4ac6e7a - e7a8b35d6


AMBARI-11444-2. Number Widgets: Empty threshold for 'Critical' still shows the 
value as Critical.(XIWANG)


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

Branch: refs/heads/trunk
Commit: e7a8b35d647cb8b07d641325904b9041382f00c1
Parents: 3e4ac6e
Author: Xi Wang xiw...@apache.org
Authored: Mon Jun 15 15:25:48 2015 -0700
Committer: Xi Wang xiw...@apache.org
Committed: Tue Jun 16 11:14:33 2015 -0700

--
 ambari-web/app/assets/test/tests.js |   2 +
 .../views/common/widget/gauge_widget_view.js|   4 +-
 .../views/common/widget/number_widget_view.js   |   2 +-
 .../common/widget/gauge_widget_view_test.js | 166 
 .../common/widget/number_widget_view_test.js| 190 +++
 5 files changed, 361 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e7a8b35d/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 7b894b7..f832a48 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -191,6 +191,8 @@ var files = ['test/init_model_test',
   'test/views/common/custom_date_popup_test',
   'test/views/common/progress_bar_view_test',
   'test/views/common/widget/graph_widget_view_test',
+  'test/views/common/widget/number_widget_view_test',
+  'test/views/common/widget/gauge_widget_view_test',
   'test/views/common/modal_popups/hosts_table_list_popup_test',
   'test/views/main/admin_test',
   'test/views/main/dashboard_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/e7a8b35d/ambari-web/app/views/common/widget/gauge_widget_view.js
--
diff --git a/ambari-web/app/views/common/widget/gauge_widget_view.js 
b/ambari-web/app/views/common/widget/gauge_widget_view.js
index 3d782cd..a1cd24b 100644
--- a/ambari-web/app/views/common/widget/gauge_widget_view.js
+++ b/ambari-web/app/views/common/widget/gauge_widget_view.js
@@ -91,12 +91,12 @@ App.GaugeWidgetView = Em.View.extend(App.WidgetMixin, {
   var color_green = App.healthStatusGreen;
   var color_red = App.healthStatusRed;
   var color_orange = App.healthStatusOrange;
-  if (isNaN(threshold1) || (isNaN(threshold2)  used = threshold1) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (used  threshold1)) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (used = threshold1))) {
+  if ((isNaN(threshold1)  isNaN(threshold2)) || (isNaN(threshold1)  
used = threshold2) || (isNaN(threshold2)  used = threshold1) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (used  threshold1)) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (used = threshold1))) {
 this.set('palette', new Rickshaw.Color.Palette({
   scheme: [ '#FF', color_green  ].reverse()
 }));
 return color_green;
-  } else if ((!isNaN(threshold2)  used.isInRange(threshold1, 
threshold2)) || (isNaN(threshold2)  used  threshold1) ) {
+  } else if ((!isNaN(threshold2)  used.isInRange(threshold1, 
threshold2)) || (isNaN(threshold2)  used  threshold1)) {
 this.set('palette', new Rickshaw.Color.Palette({
   scheme: [ '#FF', color_orange  ].reverse()
 }));

http://git-wip-us.apache.org/repos/asf/ambari/blob/e7a8b35d/ambari-web/app/views/common/widget/number_widget_view.js
--
diff --git a/ambari-web/app/views/common/widget/number_widget_view.js 
b/ambari-web/app/views/common/widget/number_widget_view.js
index 33bf34e..b962851 100644
--- a/ambari-web/app/views/common/widget/number_widget_view.js
+++ b/ambari-web/app/views/common/widget/number_widget_view.js
@@ -52,7 +52,7 @@ App.NumberWidgetView = Em.View.extend(App.WidgetMixin, {
 
 if (isNaN(value)) {
   return 'grey';
-} else if (isNaN(threshold1) || (isNaN(threshold2)  value = threshold1) 
|| (!isNaN(threshold2)  (threshold1  threshold2)  (value  threshold1)) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (value = threshold1))) {
+} else if ((isNaN(threshold1)  isNaN(threshold2)) || (isNaN(threshold1) 
 value = threshold2) || (isNaN(threshold2)  value = threshold1) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (value  threshold1)) || 
(!isNaN(threshold2)  (threshold1  threshold2)  (value = threshold1))) {
   return 'green';
 } else if ((!isNaN(threshold2)  value.isInRange(threshold1, threshold2)) 
|| ((isNaN(threshold2)  

ambari git commit: AMBARI-11959. Remove Tez UI property from exported Blueprint. (rnettleton)

2015-06-16 Thread rnettleton
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 22e421d05 - 9b972abdc


AMBARI-11959. Remove Tez UI property from exported Blueprint. (rnettleton)


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

Branch: refs/heads/branch-2.1
Commit: 9b972abdc559b76eddb6387471cb36952fc07f32
Parents: 22e421d
Author: Bob Nettleton rnettle...@hortonworks.com
Authored: Tue Jun 16 17:33:23 2015 -0400
Committer: Bob Nettleton rnettle...@hortonworks.com
Committed: Tue Jun 16 17:34:56 2015 -0400

--
 .../BlueprintConfigurationProcessor.java| 28 ++-
 .../BlueprintConfigurationProcessorTest.java| 36 
 2 files changed, 63 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9b972abd/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 9d49714..af3b331 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -125,7 +125,9 @@ public class BlueprintConfigurationProcessor {
* This will initially be used to filter out the Ranger Passwords, but
* could be extended in the future for more generic purposes.
*/
-  private static final PropertyFilter[] exportPropertyFilters = { new 
PasswordPropertyFilter() };
+  private static final PropertyFilter[] exportPropertyFilters =
+{ new PasswordPropertyFilter(),
+  new SimplePropertyNameExportFilter(tez.tez-ui.history-url.base, 
tez-site)};
 
   /**
* Statically-defined list of filters to apply on cluster config
@@ -2161,6 +2163,30 @@ public class BlueprintConfigurationProcessor {
 }
   }
 
+  /**
+   * Simple filter implementation used to remove named properties from
+   * a Blueprint export.  Some properties with hostname information set
+   * by the UI do not have straightforward mappings to hosts, so these 
properties
+   * cannot be exported via the default HOSTGROUP mechanism.
+   */
+  private static class SimplePropertyNameExportFilter implements 
PropertyFilter {
+
+private final String propertyName;
+
+private final String propertyConfigType;
+
+SimplePropertyNameExportFilter(String propertyName, String 
propertyConfigType) {
+  this.propertyName = propertyName;
+  this.propertyConfigType = propertyConfigType;
+}
+
+@Override
+public boolean isPropertyIncluded(String propertyName, String 
propertyValue, String configType, ClusterTopology topology) {
+  return !(this.propertyConfigType.equals(configType) 
+ this.propertyName.equals(propertyName));
+}
+  }
+
 
   /**
* Filter implementation that determines if a property should be included in

http://git-wip-us.apache.org/repos/asf/ambari/blob/9b972abd/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index a0c29e8..abf5675 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -679,6 +679,42 @@ public class BlueprintConfigurationProcessorTest {
   }
 
   @Test
+  public void testTezConfigExport() throws Exception {
+final String expectedHostName = c6401.apache.ambari.org;
+final String expectedHostGroupName = host_group_1;
+
+MapString, MapString, String configProperties = new HashMapString, 
MapString, String();
+MapString, String tezSiteProperties = new HashMapString, String();
+configProperties.put(tez-site, tezSiteProperties);
+
+// set the UI property, to simulate the case of a UI-created cluster with 
TEZ
+tezSiteProperties.put(tez.tez-ui.history-url.base, 
http://host:port/TEZ/TEZ_VIEW;);
+
+Configuration clusterConfig = new Configuration(configProperties,
+  

[1/2] ambari git commit: AMBARI-11962. Some added properties changing during deploy (alexantonenko)

2015-06-16 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 1cdf8864c - 0930a74fc


AMBARI-11962. Some added properties changing during deploy (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 0930a74fc54ac21e67c2a912de9618bcb2e65169
Parents: 5c47a61
Author: Alex Antonenko hiv...@gmail.com
Authored: Tue Jun 16 23:48:19 2015 +0300
Committer: Alex Antonenko hiv...@gmail.com
Committed: Wed Jun 17 00:53:55 2015 +0300

--
 ambari-web/app/controllers/wizard/step8_controller.js | 13 +++--
 ambari-web/test/controllers/wizard/step8_test.js  | 11 +--
 2 files changed, 20 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0930a74f/ambari-web/app/controllers/wizard/step8_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js 
b/ambari-web/app/controllers/wizard/step8_controller.js
index b44f900..c167f68 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -384,13 +384,22 @@ App.WizardStep8Controller = 
Em.Controller.extend(App.AddSecurityConfigs, App.wiz
 var dependentConfig = $.extend(true, [], 
configMapping.filterProperty('foreignKey'));
 dependentConfig.forEach(function (_config) {
   App.config.setConfigValue(uiConfig, 
this.get('content.serviceConfigProperties'), _config);
-  if(!_config.noMatchSoSkipThisConfig)
+  // generated config name using template for example 
`hadoop.proxyuser.hive.hosts`
+  var configName = _config._name || _config.name;
+  // property from codecontent.serviceConfigProperties/code. This 
property can be added in custom-site.xml
+  // with the same name as propety from defined config mapping. In this 
case property from config mapping
+  // object should be ignored.
+  var isPropertyDefined = this.get('content.serviceConfigProperties')
+.filterProperty('filename', _config.filename).someProperty('name', 
configName);
+  // ignore config mapping property if no matches for template was found 
or property already added by user
+  if(!_config.noMatchSoSkipThisConfig  !isPropertyDefined) {
 uiConfig.pushObject({
   id: site property,
-  name: _config._name || _config.name,
+  name: configName,
   value: _config.value,
   filename: _config.filename
 });
+  }
 }, this);
 return uiConfig;
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/0930a74f/ambari-web/test/controllers/wizard/step8_test.js
--
diff --git a/ambari-web/test/controllers/wizard/step8_test.js 
b/ambari-web/test/controllers/wizard/step8_test.js
index 67eb04a..a869663 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -1765,9 +1765,13 @@ describe('App.WizardStep8Controller', function () {
   describe('#loadUiSideConfigs', function() {
 beforeEach(function() {
   sinon.stub(App.config, 'setConfigValue', Em.K);
+  sinon.stub(installerStep8Controller, 
'get').withArgs('content.serviceConfigProperties').returns([
+{ name: 'c9', filename: 'f3'}
+  ]);
 });
 afterEach(function() {
   App.config.setConfigValue.restore();
+  installerStep8Controller.get.restore();
 });
 
 it('configs with foreignKey', function() {
@@ -1775,10 +1779,13 @@ describe('App.WizardStep8Controller', function () {
 {foreignKey: 'fk1', templateName: 't5', value: 'v5', name: 'c5', 
filename: 'f1'},
 {foreignKey: 'fk2', templateName: 't6', value: 'v6', name: 'c6', 
filename: 'f1'},
 {foreignKey: 'fk3', templateName: 't7', value: 'v7', name: 'c7', 
filename: 'f2'},
-{foreignKey: 'fk4', templateName: 't8', value: 'v8', name: 'c8', 
filename: 'f2'}
+{foreignKey: 'fk4', templateName: 't8', value: 'v8', name: 'c8', 
filename: 'f2'},
+{foreignKey: 'fk5', templateName: 't9', value: 'v9', name: 'c9', 
filename: 'f3'}
   ];
   var uiConfigs = 
installerStep8Controller.loadUiSideConfigs(configMapping);
-  expect(uiConfigs.length).to.equal(configMapping.length);
+  // should ignore one config that was saved in 
contentServiceConfigProperties
+  expect(uiConfigs.length).to.equal(configMapping.length - 1);
+  expect(uiConfigs.findProperty('name', 'c9')).to.be.undefined;
   expect(uiConfigs.everyProperty('id', 'site property')).to.be.true;
   uiConfigs.forEach(function(c, 

ambari git commit: AMBARI-11957 - Views : DataStore persistence error (tbeerbower)

2015-06-16 Thread tbeerbower
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 9b972abdc - 48557ec18


AMBARI-11957 - Views : DataStore persistence error (tbeerbower)


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

Branch: refs/heads/branch-2.1
Commit: 48557ec1870807d27e87c5be3c942f4a1ad23226
Parents: 9b972ab
Author: tbeerbower tbeerbo...@hortonworks.com
Authored: Tue Jun 16 17:36:51 2015 -0400
Committer: tbeerbower tbeerbo...@hortonworks.com
Committed: Tue Jun 16 17:37:43 2015 -0400

--
 .../server/view/persistence/DataStoreImpl.java  |  30 +++--
 .../view/persistence/DataStoreImplTest.java | 121 +++
 2 files changed, 144 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/48557ec1/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
index 8353d63..69328e7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
@@ -25,14 +25,17 @@ import org.apache.ambari.view.PersistenceException;
 import org.eclipse.persistence.dynamic.DynamicClassLoader;
 import org.eclipse.persistence.dynamic.DynamicEntity;
 import org.eclipse.persistence.dynamic.DynamicType;
+import org.eclipse.persistence.internal.helper.DatabaseField;
 import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
 import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
+import org.eclipse.persistence.mappings.DirectToFieldMapping;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.inject.Inject;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
+import javax.persistence.EntityTransaction;
 import javax.persistence.Query;
 import java.beans.IntrospectionException;
 import java.beans.Introspector;
@@ -41,6 +44,8 @@ import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
+import java.sql.Clob;
+import java.sql.Types;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -131,9 +136,7 @@ public class DataStoreImpl implements DataStore {
 persistEntity(entity, em, new HashSetDynamicEntity());
 em.getTransaction().commit();
   } catch (Exception e) {
-if (em.getTransaction()!= null) {
-  em.getTransaction().rollback();
-}
+rollbackTransaction(em.getTransaction());
 throwPersistenceException(Caught exception trying to store view 
entity  + entity, e);
   }
 } finally {
@@ -162,9 +165,7 @@ public class DataStoreImpl implements DataStore {
   em.remove(dynamicEntity);
   em.getTransaction().commit();
 } catch (Exception e) {
-  if (em.getTransaction()!= null) {
-em.getTransaction().rollback();
-  }
+  rollbackTransaction(em.getTransaction());
   throwPersistenceException(Caught exception trying to remove 
view entity  + entity, e);
 }
   }
@@ -297,7 +298,15 @@ public class DataStoreImpl implements DataStore {
 Class? propertyType = descriptor.getPropertyType();
 
 if (isDirectMappingType(propertyType)) {
-  typeBuilder.addDirectMapping(attributeName, propertyType, 
attributeName);
+  DirectToFieldMapping mapping = 
typeBuilder.addDirectMapping(attributeName, propertyType, attributeName);
+
+  // explicitly set the type of string fields
+  if (String.class.isAssignableFrom(propertyType)) {
+DatabaseField field = mapping.getField();
+
+field.setSqlType(Types.CLOB);
+field.setType(Clob.class);
+  }
 }
   }
 }
@@ -593,6 +602,13 @@ public class DataStoreImpl implements DataStore {
 return (Class?) parameterizedType.getActualTypeArguments()[0];
   }
 
+  // rollback the given transaction if it is active
+  private static void rollbackTransaction(EntityTransaction transaction) {
+if (transaction != null  transaction.isActive()) {
+  transaction.rollback();
+}
+  }
+
   // throw a new persistence exception and log the error
   private static void throwPersistenceException(String msg, Exception e) 
throws PersistenceException {

[2/2] ambari git commit: AMBARI-11944. Service Accts names are not correct on add service (alexantonenko)

2015-06-16 Thread alexantonenko
AMBARI-11944. Service Accts names are not correct on add service (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 5c47a61f390fe0ea565b3ab9b3303f4ed984b592
Parents: 1cdf886
Author: Alex Antonenko hiv...@gmail.com
Authored: Tue Jun 16 15:29:19 2015 +0300
Committer: Alex Antonenko hiv...@gmail.com
Committed: Wed Jun 17 00:53:55 2015 +0300

--
 .../controllers/main/admin/serviceAccounts_controller.js| 9 +
 1 file changed, 9 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5c47a61f/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js 
b/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
index e4f1918..1b1b674 100644
--- a/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
+++ b/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
@@ -81,6 +81,15 @@ App.MainAdminServiceAccountsController = 
App.MainServiceInfoConfigsController.ex
 
 miscConfigs = App.config.miscConfigVisibleProperty(miscConfigs, 
App.Service.find().mapProperty('serviceName').concat('MISC'));
 
+// load specific users along the wizards which called 
codeloadUsers/code method
+var wizardContentProperties = [
+  {key: 'group', configName: 'user_group'},
+  {key: 'smokeuser', configName: 'smokeuser'},
+  {key: 'hdfsUser', configName: 'hdfs_user'}
+];
+wizardContentProperties.forEach(function(item) {
+  this.setContentProperty(item.key, item.configName, miscConfigs);
+}, this);
 this.set('users', miscConfigs.filterProperty('isVisible'));
 this.set('dataIsLoaded', true);
   },



[1/2] ambari git commit: AMBARI-11944. Service Accts names are not correct on add service (alexantonenko)

2015-06-16 Thread alexantonenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 48557ec18 - 8cedc3bbc


AMBARI-11944. Service Accts names are not correct on add service (alexantonenko)


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

Branch: refs/heads/branch-2.1
Commit: b8c3f017bacde358c869a59117c17029f24913e4
Parents: 48557ec
Author: Alex Antonenko hiv...@gmail.com
Authored: Tue Jun 16 15:29:19 2015 +0300
Committer: Alex Antonenko hiv...@gmail.com
Committed: Wed Jun 17 01:01:08 2015 +0300

--
 .../controllers/main/admin/serviceAccounts_controller.js| 9 +
 1 file changed, 9 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b8c3f017/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js 
b/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
index e4f1918..1b1b674 100644
--- a/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
+++ b/ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
@@ -81,6 +81,15 @@ App.MainAdminServiceAccountsController = 
App.MainServiceInfoConfigsController.ex
 
 miscConfigs = App.config.miscConfigVisibleProperty(miscConfigs, 
App.Service.find().mapProperty('serviceName').concat('MISC'));
 
+// load specific users along the wizards which called 
codeloadUsers/code method
+var wizardContentProperties = [
+  {key: 'group', configName: 'user_group'},
+  {key: 'smokeuser', configName: 'smokeuser'},
+  {key: 'hdfsUser', configName: 'hdfs_user'}
+];
+wizardContentProperties.forEach(function(item) {
+  this.setContentProperty(item.key, item.configName, miscConfigs);
+}, this);
 this.set('users', miscConfigs.filterProperty('isVisible'));
 this.set('dataIsLoaded', true);
   },



[2/2] ambari git commit: AMBARI-11962. Some added properties changing during deploy (alexantonenko)

2015-06-16 Thread alexantonenko
AMBARI-11962. Some added properties changing during deploy (alexantonenko)


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

Branch: refs/heads/branch-2.1
Commit: 8cedc3bbc078a0349f2811a4625cb3f33a7e14c6
Parents: b8c3f01
Author: Alex Antonenko hiv...@gmail.com
Authored: Tue Jun 16 23:48:19 2015 +0300
Committer: Alex Antonenko hiv...@gmail.com
Committed: Wed Jun 17 01:01:09 2015 +0300

--
 ambari-web/app/controllers/wizard/step8_controller.js | 13 +++--
 ambari-web/test/controllers/wizard/step8_test.js  | 11 +--
 2 files changed, 20 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8cedc3bb/ambari-web/app/controllers/wizard/step8_controller.js
--
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js 
b/ambari-web/app/controllers/wizard/step8_controller.js
index b44f900..c167f68 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -384,13 +384,22 @@ App.WizardStep8Controller = 
Em.Controller.extend(App.AddSecurityConfigs, App.wiz
 var dependentConfig = $.extend(true, [], 
configMapping.filterProperty('foreignKey'));
 dependentConfig.forEach(function (_config) {
   App.config.setConfigValue(uiConfig, 
this.get('content.serviceConfigProperties'), _config);
-  if(!_config.noMatchSoSkipThisConfig)
+  // generated config name using template for example 
`hadoop.proxyuser.hive.hosts`
+  var configName = _config._name || _config.name;
+  // property from codecontent.serviceConfigProperties/code. This 
property can be added in custom-site.xml
+  // with the same name as propety from defined config mapping. In this 
case property from config mapping
+  // object should be ignored.
+  var isPropertyDefined = this.get('content.serviceConfigProperties')
+.filterProperty('filename', _config.filename).someProperty('name', 
configName);
+  // ignore config mapping property if no matches for template was found 
or property already added by user
+  if(!_config.noMatchSoSkipThisConfig  !isPropertyDefined) {
 uiConfig.pushObject({
   id: site property,
-  name: _config._name || _config.name,
+  name: configName,
   value: _config.value,
   filename: _config.filename
 });
+  }
 }, this);
 return uiConfig;
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cedc3bb/ambari-web/test/controllers/wizard/step8_test.js
--
diff --git a/ambari-web/test/controllers/wizard/step8_test.js 
b/ambari-web/test/controllers/wizard/step8_test.js
index 67eb04a..a869663 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -1765,9 +1765,13 @@ describe('App.WizardStep8Controller', function () {
   describe('#loadUiSideConfigs', function() {
 beforeEach(function() {
   sinon.stub(App.config, 'setConfigValue', Em.K);
+  sinon.stub(installerStep8Controller, 
'get').withArgs('content.serviceConfigProperties').returns([
+{ name: 'c9', filename: 'f3'}
+  ]);
 });
 afterEach(function() {
   App.config.setConfigValue.restore();
+  installerStep8Controller.get.restore();
 });
 
 it('configs with foreignKey', function() {
@@ -1775,10 +1779,13 @@ describe('App.WizardStep8Controller', function () {
 {foreignKey: 'fk1', templateName: 't5', value: 'v5', name: 'c5', 
filename: 'f1'},
 {foreignKey: 'fk2', templateName: 't6', value: 'v6', name: 'c6', 
filename: 'f1'},
 {foreignKey: 'fk3', templateName: 't7', value: 'v7', name: 'c7', 
filename: 'f2'},
-{foreignKey: 'fk4', templateName: 't8', value: 'v8', name: 'c8', 
filename: 'f2'}
+{foreignKey: 'fk4', templateName: 't8', value: 'v8', name: 'c8', 
filename: 'f2'},
+{foreignKey: 'fk5', templateName: 't9', value: 'v9', name: 'c9', 
filename: 'f3'}
   ];
   var uiConfigs = 
installerStep8Controller.loadUiSideConfigs(configMapping);
-  expect(uiConfigs.length).to.equal(configMapping.length);
+  // should ignore one config that was saved in 
contentServiceConfigProperties
+  expect(uiConfigs.length).to.equal(configMapping.length - 1);
+  expect(uiConfigs.findProperty('name', 'c9')).to.be.undefined;
   expect(uiConfigs.everyProperty('id', 'site property')).to.be.true;
   uiConfigs.forEach(function(c, index) {
 if (Em.isNone(configMapping[index].foreignKey))



ambari git commit: AMBARI-11957 - Views : DataStore persistence error (tbeerbower)

2015-06-16 Thread tbeerbower
Repository: ambari
Updated Branches:
  refs/heads/trunk ac508b8df - 1cdf8864c


AMBARI-11957 - Views : DataStore persistence error (tbeerbower)


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

Branch: refs/heads/trunk
Commit: 1cdf8864c1d52d44a910b836e31acf6f6ded161d
Parents: ac508b8
Author: tbeerbower tbeerbo...@hortonworks.com
Authored: Tue Jun 16 17:36:51 2015 -0400
Committer: tbeerbower tbeerbo...@hortonworks.com
Committed: Tue Jun 16 17:36:59 2015 -0400

--
 .../server/view/persistence/DataStoreImpl.java  |  30 +++--
 .../view/persistence/DataStoreImplTest.java | 121 +++
 2 files changed, 144 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1cdf8864/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
index 8353d63..69328e7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java
@@ -25,14 +25,17 @@ import org.apache.ambari.view.PersistenceException;
 import org.eclipse.persistence.dynamic.DynamicClassLoader;
 import org.eclipse.persistence.dynamic.DynamicEntity;
 import org.eclipse.persistence.dynamic.DynamicType;
+import org.eclipse.persistence.internal.helper.DatabaseField;
 import org.eclipse.persistence.jpa.dynamic.JPADynamicHelper;
 import org.eclipse.persistence.jpa.dynamic.JPADynamicTypeBuilder;
+import org.eclipse.persistence.mappings.DirectToFieldMapping;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.inject.Inject;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
+import javax.persistence.EntityTransaction;
 import javax.persistence.Query;
 import java.beans.IntrospectionException;
 import java.beans.Introspector;
@@ -41,6 +44,8 @@ import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
+import java.sql.Clob;
+import java.sql.Types;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -131,9 +136,7 @@ public class DataStoreImpl implements DataStore {
 persistEntity(entity, em, new HashSetDynamicEntity());
 em.getTransaction().commit();
   } catch (Exception e) {
-if (em.getTransaction()!= null) {
-  em.getTransaction().rollback();
-}
+rollbackTransaction(em.getTransaction());
 throwPersistenceException(Caught exception trying to store view 
entity  + entity, e);
   }
 } finally {
@@ -162,9 +165,7 @@ public class DataStoreImpl implements DataStore {
   em.remove(dynamicEntity);
   em.getTransaction().commit();
 } catch (Exception e) {
-  if (em.getTransaction()!= null) {
-em.getTransaction().rollback();
-  }
+  rollbackTransaction(em.getTransaction());
   throwPersistenceException(Caught exception trying to remove 
view entity  + entity, e);
 }
   }
@@ -297,7 +298,15 @@ public class DataStoreImpl implements DataStore {
 Class? propertyType = descriptor.getPropertyType();
 
 if (isDirectMappingType(propertyType)) {
-  typeBuilder.addDirectMapping(attributeName, propertyType, 
attributeName);
+  DirectToFieldMapping mapping = 
typeBuilder.addDirectMapping(attributeName, propertyType, attributeName);
+
+  // explicitly set the type of string fields
+  if (String.class.isAssignableFrom(propertyType)) {
+DatabaseField field = mapping.getField();
+
+field.setSqlType(Types.CLOB);
+field.setType(Clob.class);
+  }
 }
   }
 }
@@ -593,6 +602,13 @@ public class DataStoreImpl implements DataStore {
 return (Class?) parameterizedType.getActualTypeArguments()[0];
   }
 
+  // rollback the given transaction if it is active
+  private static void rollbackTransaction(EntityTransaction transaction) {
+if (transaction != null  transaction.isActive()) {
+  transaction.rollback();
+}
+  }
+
   // throw a new persistence exception and log the error
   private static void throwPersistenceException(String msg, Exception e) 
throws PersistenceException {
 

ambari git commit: AMBARI-11956. HBase Master stop is hanging when enabling security (Ivan Kozlov via smohanty)

2015-06-16 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/trunk 8d98d9307 - 5e2e50533


AMBARI-11956. HBase Master stop is hanging when enabling security (Ivan Kozlov 
via smohanty)


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

Branch: refs/heads/trunk
Commit: 5e2e50533add8afe3a8b9e619372bc4e20cbab47
Parents: 8d98d93
Author: Sumit Mohanty smoha...@hortonworks.com
Authored: Tue Jun 16 12:37:03 2015 -0700
Committer: Sumit Mohanty smoha...@hortonworks.com
Committed: Tue Jun 16 12:37:03 2015 -0700

--
 .../python/resource_management/core/shell.py| 42 +---
 1 file changed, 27 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5e2e5053/ambari-common/src/main/python/resource_management/core/shell.py
--
diff --git a/ambari-common/src/main/python/resource_management/core/shell.py 
b/ambari-common/src/main/python/resource_management/core/shell.py
index 75b5fcf..75d4e56 100644
--- a/ambari-common/src/main/python/resource_management/core/shell.py
+++ b/ambari-common/src/main/python/resource_management/core/shell.py
@@ -212,9 +212,9 @@ def _call(command, logoutput=None, throw_on_failure=True, 
stdout=subprocess.PIPE
 preexec_fn=preexec_fn)
 
 if timeout:
-  timeout_happened=False
-  start = time.time()
-  end = start+timeout
+  timeout_event = threading.Event()
+  t = threading.Timer( timeout, _on_timeout, [proc, timeout_event] )
+  t.start()
   
 if not wait_for_finish:
   return proc
@@ -235,11 +235,13 @@ def _call(command, logoutput=None, throw_on_failure=True, 
stdout=subprocess.PIPE
 all_output = 
   
 while read_set:
-  if timeout and time.time() end:
-timeout_happened=True
-proc.kill()
+
+  is_proccess_running = (proc.poll() == None)
+  ready, _, _ = select.select(read_set, [], [], 1)
+
+  if not is_proccess_running and not ready:
 break
-  ready, _, _ = select.select(read_set, [], [])
+
   for out_fd in read_set:
 if out_fd in ready:
   line = os.read(out_fd.fileno(), 1024)
@@ -247,6 +249,7 @@ def _call(command, logoutput=None, throw_on_failure=True, 
stdout=subprocess.PIPE
   if not line:
 read_set = copy.copy(read_set)
 read_set.remove(out_fd)
+out_fd.close()
 continue
   
   fd_to_string[out_fd] += line
@@ -263,12 +266,7 @@ def _call(command, logoutput=None, throw_on_failure=True, 
stdout=subprocess.PIPE
 _print(line)
   
 # Wait for process to terminate
-while proc.poll() == None:
-  if timeout and time.time() end:
-timeout_happened=True
-proc.kill()
-break
-  time.sleep(1)
+proc.wait()
 
   finally:
 for fp in files_to_close:
@@ -279,7 +277,10 @@ def _call(command, logoutput=None, throw_on_failure=True, 
stdout=subprocess.PIPE
   all_output = all_output.strip('\n')
   
   if timeout: 
-if timeout_happened:
+if not timeout_event.is_set():
+  t.cancel()
+# timeout occurred
+else:
   err_msg = (Execution of '%s' was killed due timeout after %d seconds) 
% (command, timeout)
   raise ExecuteTimeoutException(err_msg)

@@ -360,4 +361,15 @@ def string_cmd_from_args_list(command, auto_escape=True):
 
 def _print(line):
   sys.stdout.write(line)
-  sys.stdout.flush()
\ No newline at end of file
+  sys.stdout.flush()
+
+def _on_timeout(proc, timeout_event):
+  timeout_event.set()
+  if proc.poll() == None:
+try:
+  proc.terminate()
+  proc.wait()
+# catch race condition if proc already dead
+except OSError:
+  pass
+



ambari git commit: AMBARI-11941 - RU: Pre Upgrade HDFS Fails Due To Kerberos Security Exception (jonathanhurley)

2015-06-16 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 a03011c7d - 22e421d05


AMBARI-11941 - RU: Pre Upgrade HDFS Fails Due To Kerberos Security Exception 
(jonathanhurley)


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

Branch: refs/heads/branch-2.1
Commit: 22e421d05987930fb32d8344e6ea184780325215
Parents: a03011c
Author: Jonathan Hurley jhur...@hortonworks.com
Authored: Tue Jun 16 13:59:55 2015 -0400
Committer: Jonathan Hurley jhur...@hortonworks.com
Committed: Tue Jun 16 16:28:56 2015 -0400

--
 .../package/scripts/namenode_upgrade.py |  6 ++-
 .../python/stacks/2.0.6/HDFS/test_namenode.py   | 43 +++-
 2 files changed, 28 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/22e421d0/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
index bc1e3ad..59fef7d 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
@@ -91,7 +91,8 @@ def prepare_rolling_upgrade():
   Logger.info(format(Performing a(n) {params.upgrade_direction} of HDFS))
 
   if params.security_enabled:
-Execute(format({params.kinit_path_local} -kt {params.hdfs_user_keytab} 
{params.hdfs_principal_name}))
+kinit_command = format({params.kinit_path_local} -kt 
{params.hdfs_user_keytab} {params.hdfs_principal_name}) 
+Execute(kinit_command, user=params.hdfs_user, logoutput=True)
 
 
   if params.upgrade_direction == Direction.UPGRADE:
@@ -118,7 +119,8 @@ def finalize_rolling_upgrade():
   import params
 
   if params.security_enabled:
-Execute(format({params.kinit_path_local} -kt {params.hdfs_user_keytab} 
{params.hdfs_principal_name}))
+kinit_command = format({params.kinit_path_local} -kt 
{params.hdfs_user_keytab} {params.hdfs_principal_name}) 
+Execute(kinit_command, user=params.hdfs_user, logoutput=True)
 
   finalize_cmd = hdfs dfsadmin -rollingUpgrade finalize
   query_cmd = hdfs dfsadmin -rollingUpgrade query

http://git-wip-us.apache.org/repos/asf/ambari/blob/22e421d0/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
--
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py 
b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
index f6c3b1a..f88d51e 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
@@ -1211,21 +1211,22 @@ class TestNamenode(RMFTestCase):
 json_content['commandParams']['upgrade_direction'] = 'upgrade'
 
 self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
/scripts/namenode.py,
-   classname = NameNode,
-   command = prepare_rolling_upgrade,
-   config_dict = json_content,
-   hdp_stack_version = self.STACK_VERSION,
-   target = RMFTestCase.TARGET_COMMON_SERVICES,
-   call_mocks = [(0, Safe mode is OFF in 
c6401.ambari.apache.org)])
-self.assertResourceCalled('Execute', '/usr/bin/kinit -kt 
/etc/security/keytabs/hdfs.headless.keytab hdfs',)
+  classname = NameNode,
+  command = prepare_rolling_upgrade,
+  config_dict = json_content,
+  hdp_stack_version = self.STACK_VERSION,
+  target = RMFTestCase.TARGET_COMMON_SERVICES,
+  call_mocks = [(0, Safe mode is OFF in c6401.ambari.apache.org)])
+
+self.assertResourceCalled('Execute', '/usr/bin/kinit -kt 
/etc/security/keytabs/hdfs.headless.keytab hdfs',
+  logoutput = True, user = 'hdfs')
+
 self.assertResourceCalled('Execute', 'hdfs dfsadmin -rollingUpgrade 
prepare',
-  logoutput = True,
-  user = 'hdfs',
-  )
+  logoutput = True, user = 'hdfs')
+
 self.assertResourceCalled('Execute', 'hdfs dfsadmin -rollingUpgrade query',
-  logoutput = True,
-  user = 'hdfs',
-  )
+  logoutput = True, user = 'hdfs')
+
 self.assertNoMoreResources()
   
 
@@ -1241,12 +1242,16 @@ class 

ambari git commit: AMBARI-11941 - RU: Pre Upgrade HDFS Fails Due To Kerberos Security Exception (jonathanhurley)

2015-06-16 Thread jonathanhurley
Repository: ambari
Updated Branches:
  refs/heads/trunk 3197470db - 8da4ca1b4


AMBARI-11941 - RU: Pre Upgrade HDFS Fails Due To Kerberos Security Exception 
(jonathanhurley)


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

Branch: refs/heads/trunk
Commit: 8da4ca1b45a6b01956699aab869dcbe265f28e2e
Parents: 3197470
Author: Jonathan Hurley jhur...@hortonworks.com
Authored: Tue Jun 16 13:59:55 2015 -0400
Committer: Jonathan Hurley jhur...@hortonworks.com
Committed: Tue Jun 16 16:28:15 2015 -0400

--
 .../package/scripts/namenode_upgrade.py |  6 ++-
 .../python/stacks/2.0.6/HDFS/test_namenode.py   | 43 +++-
 2 files changed, 28 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8da4ca1b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
index bc1e3ad..59fef7d 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
@@ -91,7 +91,8 @@ def prepare_rolling_upgrade():
   Logger.info(format(Performing a(n) {params.upgrade_direction} of HDFS))
 
   if params.security_enabled:
-Execute(format({params.kinit_path_local} -kt {params.hdfs_user_keytab} 
{params.hdfs_principal_name}))
+kinit_command = format({params.kinit_path_local} -kt 
{params.hdfs_user_keytab} {params.hdfs_principal_name}) 
+Execute(kinit_command, user=params.hdfs_user, logoutput=True)
 
 
   if params.upgrade_direction == Direction.UPGRADE:
@@ -118,7 +119,8 @@ def finalize_rolling_upgrade():
   import params
 
   if params.security_enabled:
-Execute(format({params.kinit_path_local} -kt {params.hdfs_user_keytab} 
{params.hdfs_principal_name}))
+kinit_command = format({params.kinit_path_local} -kt 
{params.hdfs_user_keytab} {params.hdfs_principal_name}) 
+Execute(kinit_command, user=params.hdfs_user, logoutput=True)
 
   finalize_cmd = hdfs dfsadmin -rollingUpgrade finalize
   query_cmd = hdfs dfsadmin -rollingUpgrade query

http://git-wip-us.apache.org/repos/asf/ambari/blob/8da4ca1b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
--
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py 
b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
index f6c3b1a..f88d51e 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
@@ -1211,21 +1211,22 @@ class TestNamenode(RMFTestCase):
 json_content['commandParams']['upgrade_direction'] = 'upgrade'
 
 self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + 
/scripts/namenode.py,
-   classname = NameNode,
-   command = prepare_rolling_upgrade,
-   config_dict = json_content,
-   hdp_stack_version = self.STACK_VERSION,
-   target = RMFTestCase.TARGET_COMMON_SERVICES,
-   call_mocks = [(0, Safe mode is OFF in 
c6401.ambari.apache.org)])
-self.assertResourceCalled('Execute', '/usr/bin/kinit -kt 
/etc/security/keytabs/hdfs.headless.keytab hdfs',)
+  classname = NameNode,
+  command = prepare_rolling_upgrade,
+  config_dict = json_content,
+  hdp_stack_version = self.STACK_VERSION,
+  target = RMFTestCase.TARGET_COMMON_SERVICES,
+  call_mocks = [(0, Safe mode is OFF in c6401.ambari.apache.org)])
+
+self.assertResourceCalled('Execute', '/usr/bin/kinit -kt 
/etc/security/keytabs/hdfs.headless.keytab hdfs',
+  logoutput = True, user = 'hdfs')
+
 self.assertResourceCalled('Execute', 'hdfs dfsadmin -rollingUpgrade 
prepare',
-  logoutput = True,
-  user = 'hdfs',
-  )
+  logoutput = True, user = 'hdfs')
+
 self.assertResourceCalled('Execute', 'hdfs dfsadmin -rollingUpgrade query',
-  logoutput = True,
-  user = 'hdfs',
-  )
+  logoutput = True, user = 'hdfs')
+
 self.assertNoMoreResources()
   
 
@@ -1241,12 +1242,16 @@ class 

ambari git commit: AMBARI-11956. HBase Master stop is hanging when enabling security (Ivan Kozlov via smohanty)

2015-06-16 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 8a211325e - c3bec2242


AMBARI-11956. HBase Master stop is hanging when enabling security (Ivan Kozlov 
via smohanty)


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

Branch: refs/heads/branch-2.1
Commit: c3bec2242a4aec8f2c5ccaf2ea28a9c4c384ecba
Parents: 8a21132
Author: Sumit Mohanty smoha...@hortonworks.com
Authored: Tue Jun 16 12:37:03 2015 -0700
Committer: Sumit Mohanty smoha...@hortonworks.com
Committed: Tue Jun 16 12:43:25 2015 -0700

--
 .../python/resource_management/core/shell.py| 42 +---
 1 file changed, 27 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c3bec224/ambari-common/src/main/python/resource_management/core/shell.py
--
diff --git a/ambari-common/src/main/python/resource_management/core/shell.py 
b/ambari-common/src/main/python/resource_management/core/shell.py
index 75b5fcf..75d4e56 100644
--- a/ambari-common/src/main/python/resource_management/core/shell.py
+++ b/ambari-common/src/main/python/resource_management/core/shell.py
@@ -212,9 +212,9 @@ def _call(command, logoutput=None, throw_on_failure=True, 
stdout=subprocess.PIPE
 preexec_fn=preexec_fn)
 
 if timeout:
-  timeout_happened=False
-  start = time.time()
-  end = start+timeout
+  timeout_event = threading.Event()
+  t = threading.Timer( timeout, _on_timeout, [proc, timeout_event] )
+  t.start()
   
 if not wait_for_finish:
   return proc
@@ -235,11 +235,13 @@ def _call(command, logoutput=None, throw_on_failure=True, 
stdout=subprocess.PIPE
 all_output = 
   
 while read_set:
-  if timeout and time.time() end:
-timeout_happened=True
-proc.kill()
+
+  is_proccess_running = (proc.poll() == None)
+  ready, _, _ = select.select(read_set, [], [], 1)
+
+  if not is_proccess_running and not ready:
 break
-  ready, _, _ = select.select(read_set, [], [])
+
   for out_fd in read_set:
 if out_fd in ready:
   line = os.read(out_fd.fileno(), 1024)
@@ -247,6 +249,7 @@ def _call(command, logoutput=None, throw_on_failure=True, 
stdout=subprocess.PIPE
   if not line:
 read_set = copy.copy(read_set)
 read_set.remove(out_fd)
+out_fd.close()
 continue
   
   fd_to_string[out_fd] += line
@@ -263,12 +266,7 @@ def _call(command, logoutput=None, throw_on_failure=True, 
stdout=subprocess.PIPE
 _print(line)
   
 # Wait for process to terminate
-while proc.poll() == None:
-  if timeout and time.time() end:
-timeout_happened=True
-proc.kill()
-break
-  time.sleep(1)
+proc.wait()
 
   finally:
 for fp in files_to_close:
@@ -279,7 +277,10 @@ def _call(command, logoutput=None, throw_on_failure=True, 
stdout=subprocess.PIPE
   all_output = all_output.strip('\n')
   
   if timeout: 
-if timeout_happened:
+if not timeout_event.is_set():
+  t.cancel()
+# timeout occurred
+else:
   err_msg = (Execution of '%s' was killed due timeout after %d seconds) 
% (command, timeout)
   raise ExecuteTimeoutException(err_msg)

@@ -360,4 +361,15 @@ def string_cmd_from_args_list(command, auto_escape=True):
 
 def _print(line):
   sys.stdout.write(line)
-  sys.stdout.flush()
\ No newline at end of file
+  sys.stdout.flush()
+
+def _on_timeout(proc, timeout_event):
+  timeout_event.set()
+  if proc.poll() == None:
+try:
+  proc.terminate()
+  proc.wait()
+# catch race condition if proc already dead
+except OSError:
+  pass
+



ambari git commit: AMBARI-11942. YARN Queues not showing up in Hive configs (srimanth)

2015-06-16 Thread srimanth
Repository: ambari
Updated Branches:
  refs/heads/trunk 5e2e50533 - 3197470db


AMBARI-11942. YARN Queues not showing up in Hive configs (srimanth)


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

Branch: refs/heads/trunk
Commit: 3197470db2bc4ac058c50b9d3a55d985ef4f3ac4
Parents: 5e2e505
Author: Srimanth Gunturi sgunt...@hortonworks.com
Authored: Tue Jun 16 01:51:49 2015 -0700
Committer: Srimanth Gunturi sgunt...@hortonworks.com
Committed: Tue Jun 16 12:52:35 2015 -0700

--
 .../services/HIVE/configuration/hive-site.xml   |  6 ++
 .../stacks/HDP/2.2/services/stack_advisor.py| 28 +++---
 .../stacks/2.2/common/test_stack_advisor.py | 59 
 3 files changed, 84 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3197470d/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
index 9c53773..6f9c22b 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
@@ -1592,6 +1592,12 @@ limitations under the License.
   /entries
   selection-cardinality1+/selection-cardinality
 /value-attributes
+depends-on
+  property
+typecapacity-scheduler/type
+nameyarn.scheduler.capacity.root.queues/name
+  /property
+/depends-on
   /property
 
   property

http://git-wip-us.apache.org/repos/asf/ambari/blob/3197470d/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
index 17ae78b..2b68442 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
@@ -348,17 +348,27 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
 putHiveSiteProperty(hive.server2.enable.doAs, true)
 
 yarn_queues = default
-if capacity-scheduler in configurations and \
-  yarn.scheduler.capacity.root.queues in 
configurations[capacity-scheduler][properties]:
-  yarn_queues = 
str(configurations[capacity-scheduler][properties][yarn.scheduler.capacity.root.queues])
-putHiveSiteProperty(hive.server2.tez.default.queues, yarn_queues)
-
+capacitySchedulerProperties = 
services['configurations'][capacity-scheduler][properties] if 
capacity-scheduler in services['configurations'] else {}
+if yarn.scheduler.capacity.root.queues in capacitySchedulerProperties:
+  yarn_queues = 
str(capacitySchedulerProperties[yarn.scheduler.capacity.root.queues])
 # Interactive Queues property attributes
 putHiveServerPropertyAttribute = self.putPropertyAttribute(configurations, 
hiveserver2-site)
-entries = []
-for queue in yarn_queues.split(,):
-  entries.append({label: str(queue) +  queue, value: queue})
-putHiveSitePropertyAttribute(hive.server2.tez.default.queues, entries, 
entries)
+toProcessQueues = yarn_queues.split(,)
+leafQueues = []
+while len(toProcessQueues)  0:
+  queue = toProcessQueues.pop();
+  queueKey = yarn.scheduler.capacity.root. + queue + .queues
+  if queueKey in capacitySchedulerProperties:
+# This is a parent queue - need to add children
+subQueues = capacitySchedulerProperties[queueKey].split(,)
+for subQueue in subQueues:
+  toProcessQueues.append(queue + . + subQueue)
+  else:
+# This is a leaf queue
+leafQueues.append({label: str(queue) +  queue, value: queue})
+leafQueues = sorted(leafQueues, key=lambda q:q['value'])
+putHiveSitePropertyAttribute(hive.server2.tez.default.queues, entries, 
leafQueues)
+putHiveSiteProperty(hive.server2.tez.default.queues, 
,.join([leafQueue['value'] for leafQueue in leafQueues]))
 
 # Security
 putHiveEnvProperty(hive_security_authorization, None)

http://git-wip-us.apache.org/repos/asf/ambari/blob/3197470d/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py 

ambari git commit: AMBARI-11942. YARN Queues not showing up in Hive configs (srimanth)

2015-06-16 Thread srimanth
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 c3bec2242 - a03011c7d


AMBARI-11942. YARN Queues not showing up in Hive configs (srimanth)


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

Branch: refs/heads/branch-2.1
Commit: a03011c7d2eab80e9c3543928eead3f715fc35ca
Parents: c3bec22
Author: Srimanth Gunturi sgunt...@hortonworks.com
Authored: Tue Jun 16 01:51:49 2015 -0700
Committer: Srimanth Gunturi sgunt...@hortonworks.com
Committed: Tue Jun 16 12:52:16 2015 -0700

--
 .../services/HIVE/configuration/hive-site.xml   |  6 ++
 .../stacks/HDP/2.2/services/stack_advisor.py| 28 +++---
 .../stacks/2.2/common/test_stack_advisor.py | 59 
 3 files changed, 84 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a03011c7/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
index 9c53773..6f9c22b 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/hive-site.xml
@@ -1592,6 +1592,12 @@ limitations under the License.
   /entries
   selection-cardinality1+/selection-cardinality
 /value-attributes
+depends-on
+  property
+typecapacity-scheduler/type
+nameyarn.scheduler.capacity.root.queues/name
+  /property
+/depends-on
   /property
 
   property

http://git-wip-us.apache.org/repos/asf/ambari/blob/a03011c7/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
index 17ae78b..2b68442 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py
@@ -348,17 +348,27 @@ class HDP22StackAdvisor(HDP21StackAdvisor):
 putHiveSiteProperty(hive.server2.enable.doAs, true)
 
 yarn_queues = default
-if capacity-scheduler in configurations and \
-  yarn.scheduler.capacity.root.queues in 
configurations[capacity-scheduler][properties]:
-  yarn_queues = 
str(configurations[capacity-scheduler][properties][yarn.scheduler.capacity.root.queues])
-putHiveSiteProperty(hive.server2.tez.default.queues, yarn_queues)
-
+capacitySchedulerProperties = 
services['configurations'][capacity-scheduler][properties] if 
capacity-scheduler in services['configurations'] else {}
+if yarn.scheduler.capacity.root.queues in capacitySchedulerProperties:
+  yarn_queues = 
str(capacitySchedulerProperties[yarn.scheduler.capacity.root.queues])
 # Interactive Queues property attributes
 putHiveServerPropertyAttribute = self.putPropertyAttribute(configurations, 
hiveserver2-site)
-entries = []
-for queue in yarn_queues.split(,):
-  entries.append({label: str(queue) +  queue, value: queue})
-putHiveSitePropertyAttribute(hive.server2.tez.default.queues, entries, 
entries)
+toProcessQueues = yarn_queues.split(,)
+leafQueues = []
+while len(toProcessQueues)  0:
+  queue = toProcessQueues.pop();
+  queueKey = yarn.scheduler.capacity.root. + queue + .queues
+  if queueKey in capacitySchedulerProperties:
+# This is a parent queue - need to add children
+subQueues = capacitySchedulerProperties[queueKey].split(,)
+for subQueue in subQueues:
+  toProcessQueues.append(queue + . + subQueue)
+  else:
+# This is a leaf queue
+leafQueues.append({label: str(queue) +  queue, value: queue})
+leafQueues = sorted(leafQueues, key=lambda q:q['value'])
+putHiveSitePropertyAttribute(hive.server2.tez.default.queues, entries, 
leafQueues)
+putHiveSiteProperty(hive.server2.tez.default.queues, 
,.join([leafQueue['value'] for leafQueue in leafQueues]))
 
 # Security
 putHiveEnvProperty(hive_security_authorization, None)

http://git-wip-us.apache.org/repos/asf/ambari/blob/a03011c7/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py
--
diff --git 

ambari git commit: AMBARI-11959. Remove Tez UI property from exported Blueprint. (rnettleton)

2015-06-16 Thread rnettleton
Repository: ambari
Updated Branches:
  refs/heads/trunk 8da4ca1b4 - ac508b8df


AMBARI-11959. Remove Tez UI property from exported Blueprint. (rnettleton)


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

Branch: refs/heads/trunk
Commit: ac508b8dffb923b717bf66572b0bc14ba9f2ff3f
Parents: 8da4ca1
Author: Bob Nettleton rnettle...@hortonworks.com
Authored: Tue Jun 16 16:34:52 2015 -0400
Committer: Bob Nettleton rnettle...@hortonworks.com
Committed: Tue Jun 16 16:35:39 2015 -0400

--
 .../BlueprintConfigurationProcessor.java| 28 ++-
 .../BlueprintConfigurationProcessorTest.java| 36 
 2 files changed, 63 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ac508b8d/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index 9d49714..af3b331 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -125,7 +125,9 @@ public class BlueprintConfigurationProcessor {
* This will initially be used to filter out the Ranger Passwords, but
* could be extended in the future for more generic purposes.
*/
-  private static final PropertyFilter[] exportPropertyFilters = { new 
PasswordPropertyFilter() };
+  private static final PropertyFilter[] exportPropertyFilters =
+{ new PasswordPropertyFilter(),
+  new SimplePropertyNameExportFilter(tez.tez-ui.history-url.base, 
tez-site)};
 
   /**
* Statically-defined list of filters to apply on cluster config
@@ -2161,6 +2163,30 @@ public class BlueprintConfigurationProcessor {
 }
   }
 
+  /**
+   * Simple filter implementation used to remove named properties from
+   * a Blueprint export.  Some properties with hostname information set
+   * by the UI do not have straightforward mappings to hosts, so these 
properties
+   * cannot be exported via the default HOSTGROUP mechanism.
+   */
+  private static class SimplePropertyNameExportFilter implements 
PropertyFilter {
+
+private final String propertyName;
+
+private final String propertyConfigType;
+
+SimplePropertyNameExportFilter(String propertyName, String 
propertyConfigType) {
+  this.propertyName = propertyName;
+  this.propertyConfigType = propertyConfigType;
+}
+
+@Override
+public boolean isPropertyIncluded(String propertyName, String 
propertyValue, String configType, ClusterTopology topology) {
+  return !(this.propertyConfigType.equals(configType) 
+ this.propertyName.equals(propertyName));
+}
+  }
+
 
   /**
* Filter implementation that determines if a property should be included in

http://git-wip-us.apache.org/repos/asf/ambari/blob/ac508b8d/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index a0c29e8..abf5675 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -679,6 +679,42 @@ public class BlueprintConfigurationProcessorTest {
   }
 
   @Test
+  public void testTezConfigExport() throws Exception {
+final String expectedHostName = c6401.apache.ambari.org;
+final String expectedHostGroupName = host_group_1;
+
+MapString, MapString, String configProperties = new HashMapString, 
MapString, String();
+MapString, String tezSiteProperties = new HashMapString, String();
+configProperties.put(tez-site, tezSiteProperties);
+
+// set the UI property, to simulate the case of a UI-created cluster with 
TEZ
+tezSiteProperties.put(tez.tez-ui.history-url.base, 
http://host:port/TEZ/TEZ_VIEW;);
+
+Configuration clusterConfig = new Configuration(configProperties,
+  Collections.String, 

ambari git commit: AMBARI-11953 /var/lib/ambari-metrics-collector/hbase-tmp/ is not cleaned (dsen)

2015-06-16 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 8cedc3bbc - b7d74258f


AMBARI-11953 /var/lib/ambari-metrics-collector/hbase-tmp/ is not cleaned (dsen)


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

Branch: refs/heads/branch-2.1
Commit: b7d74258f3bd2fe7ab73f2c03d774cfc11be76ed
Parents: 8cedc3b
Author: Dmytro Sen d...@apache.org
Authored: Wed Jun 17 01:29:48 2015 +0300
Committer: Dmytro Sen d...@apache.org
Committed: Wed Jun 17 01:30:37 2015 +0300

--
 .../0.1.0/package/scripts/ams_service.py|   4 +
 .../0.1.0/package/scripts/params.py |   3 +-
 .../0.1.0/package/scripts/params_linux.py   |   2 +
 .../AMBARI_METRICS/test_metrics_collector.py| 267 +++
 .../python/stacks/2.0.6/FLUME/test_flume.py |   6 +-
 .../python/stacks/2.0.6/configs/default.json| 148 +-
 6 files changed, 427 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b7d74258/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
index d348c50..2887e7c 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
@@ -50,6 +50,10 @@ def ams_service(name, action):
   cmd = format({cmd} --distributed)
 
 if action == 'start':
+  if not params.hbase_tmp_dir.startswith('hdfs'):
+Execute(format('{sudo} rm -f {hbase_tmp_dir}/*.tmp')
+)
+
   daemon_cmd = format({cmd} start)
   Execute(daemon_cmd,
   user=params.ams_user

http://git-wip-us.apache.org/repos/asf/ambari/blob/b7d74258/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
index 4c78f77..5e4da80 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
@@ -116,7 +116,8 @@ zookeeper_quorum_hosts = ','.join(ams_collector_hosts) if 
is_hbase_distributed e
 
 ams_checkpoint_dir = 
config['configurations']['ams-site']['timeline.metrics.aggregator.checkpoint.dir']
 hbase_pid_dir = status_params.hbase_pid_dir
-hbase_tmp_dir = config['configurations']['ams-hbase-site']['hbase.tmp.dir']
+_hbase_tmp_dir = config['configurations']['ams-hbase-site']['hbase.tmp.dir']
+hbase_tmp_dir = substitute_vars(_hbase_tmp_dir, 
config['configurations']['ams-hbase-site'])
 # TODO UPGRADE default, update site during upgrade
 _local_dir_conf = default('/configurations/ams-hbase-site/hbase.local.dir', 
${hbase.tmp.dir}/local)
 local_dir = substitute_vars(_local_dir_conf, 
config['configurations']['ams-hbase-site'])

http://git-wip-us.apache.org/repos/asf/ambari/blob/b7d74258/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params_linux.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params_linux.py
index 6443fe8..838e987 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params_linux.py
@@ -21,6 +21,7 @@ limitations under the License.
 from resource_management import *
 from resource_management.libraries.functions import conf_select
 from ambari_commons import OSCheck
+from ambari_commons.constants import AMBARI_SUDO_BINARY
 
 config = Script.get_config()
 
@@ -46,3 +47,4 @@ hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
 hbase_conf_dir = /etc/ams-hbase/conf
 
 limits_conf_dir = /etc/security/limits.d
+sudo = AMBARI_SUDO_BINARY


ambari git commit: AMBARI-11953 /var/lib/ambari-metrics-collector/hbase-tmp/ is not cleaned (dsen)

2015-06-16 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk 0930a74fc - 9a5edfdea


AMBARI-11953 /var/lib/ambari-metrics-collector/hbase-tmp/ is not cleaned (dsen)


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

Branch: refs/heads/trunk
Commit: 9a5edfdea27b2627952577542436e20dfddf0e81
Parents: 0930a74
Author: Dmytro Sen d...@apache.org
Authored: Wed Jun 17 01:29:48 2015 +0300
Committer: Dmytro Sen d...@apache.org
Committed: Wed Jun 17 01:29:48 2015 +0300

--
 .../0.1.0/package/scripts/ams_service.py|   4 +
 .../0.1.0/package/scripts/params.py |   3 +-
 .../0.1.0/package/scripts/params_linux.py   |   2 +
 .../AMBARI_METRICS/test_metrics_collector.py| 267 +++
 .../python/stacks/2.0.6/FLUME/test_flume.py |   6 +-
 .../python/stacks/2.0.6/configs/default.json| 148 +-
 6 files changed, 427 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9a5edfde/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
index d348c50..2887e7c 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams_service.py
@@ -50,6 +50,10 @@ def ams_service(name, action):
   cmd = format({cmd} --distributed)
 
 if action == 'start':
+  if not params.hbase_tmp_dir.startswith('hdfs'):
+Execute(format('{sudo} rm -f {hbase_tmp_dir}/*.tmp')
+)
+
   daemon_cmd = format({cmd} start)
   Execute(daemon_cmd,
   user=params.ams_user

http://git-wip-us.apache.org/repos/asf/ambari/blob/9a5edfde/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
index 4c78f77..5e4da80 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params.py
@@ -116,7 +116,8 @@ zookeeper_quorum_hosts = ','.join(ams_collector_hosts) if 
is_hbase_distributed e
 
 ams_checkpoint_dir = 
config['configurations']['ams-site']['timeline.metrics.aggregator.checkpoint.dir']
 hbase_pid_dir = status_params.hbase_pid_dir
-hbase_tmp_dir = config['configurations']['ams-hbase-site']['hbase.tmp.dir']
+_hbase_tmp_dir = config['configurations']['ams-hbase-site']['hbase.tmp.dir']
+hbase_tmp_dir = substitute_vars(_hbase_tmp_dir, 
config['configurations']['ams-hbase-site'])
 # TODO UPGRADE default, update site during upgrade
 _local_dir_conf = default('/configurations/ams-hbase-site/hbase.local.dir', 
${hbase.tmp.dir}/local)
 local_dir = substitute_vars(_local_dir_conf, 
config['configurations']['ams-hbase-site'])

http://git-wip-us.apache.org/repos/asf/ambari/blob/9a5edfde/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params_linux.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params_linux.py
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params_linux.py
index 6443fe8..838e987 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params_linux.py
+++ 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/params_linux.py
@@ -21,6 +21,7 @@ limitations under the License.
 from resource_management import *
 from resource_management.libraries.functions import conf_select
 from ambari_commons import OSCheck
+from ambari_commons.constants import AMBARI_SUDO_BINARY
 
 config = Script.get_config()
 
@@ -46,3 +47,4 @@ hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
 hbase_conf_dir = /etc/ams-hbase/conf
 
 limits_conf_dir = /etc/security/limits.d
+sudo = AMBARI_SUDO_BINARY


[2/2] ambari git commit: AMBARI-11965 - Fix high impact Outstanding Security Risks (Dmytro Shkvyra via abaranchuk)

2015-06-16 Thread abaranchuk
AMBARI-11965 - Fix high impact Outstanding Security Risks (Dmytro Shkvyra via 
abaranchuk)


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

Branch: refs/heads/branch-2.1
Commit: 2eaac094c4331e815a40a7bd13ef5bfed4f837c1
Parents: 277b931
Author: Artem Baranchuk abaranc...@hortonworks.con
Authored: Wed Jun 17 01:38:27 2015 +0300
Committer: Artem Baranchuk abaranc...@hortonworks.con
Committed: Wed Jun 17 01:38:27 2015 +0300

--
 .../metrics/timeline/PhoenixHBaseAccessor.java  |  18 +-
 .../ambari/eventdb/db/PostgresConnector.java|  12 +-
 .../ambari/server/agent/HeartBeatHandler.java   |   7 +-
 .../server/api/services/AmbariMetaInfo.java |   4 +-
 .../api/services/serializers/CsvSerializer.java |  23 +-
 .../gsinstaller/ClusterDefinition.java  |  10 +-
 .../controller/jdbc/JDBCResourceProvider.java   |  10 +-
 .../metrics/RestMetricsPropertyProvider.java|   9 +-
 .../ambari/server/orm/DBAccessorImpl.java   | 337 +++
 .../ambari/server/orm/entities/ViewEntity.java  |   1 +
 .../encryption/CredentialStoreServiceImpl.java  |   9 +-
 .../apache/ambari/server/view/ViewRegistry.java |  33 +-
 .../ambari/server/orm/DBAccessorImplTest.java   |   1 -
 .../encryption/CredentialStoreServiceTest.java  |   1 -
 .../ambari/server/view/ViewRegistryTest.java|  14 +-
 .../shell/commands/BlueprintCommands.java   |  13 +-
 16 files changed, 319 insertions(+), 183 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2eaac094/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
index 8e5d101..d018f29 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
@@ -396,7 +396,7 @@ public class PhoenixHBaseAccessor {
 try {
   //get latest
   if(condition.isPointInTime()){
-stmt = getLatestMetricRecords(condition, conn, metrics);
+getLatestMetricRecords(condition, conn, metrics);
   } else {
 stmt = PhoenixTransactSQL.prepareGetMetricsSqlStmt(conn, condition);
 rs = stmt.executeQuery();
@@ -465,7 +465,7 @@ public class PhoenixHBaseAccessor {
 }
   }
 
-  private PreparedStatement getLatestMetricRecords(
+  private void getLatestMetricRecords(
 Condition condition, Connection conn, TimelineMetrics metrics)
 throws SQLException, IOException {
 
@@ -490,9 +490,10 @@ public class PhoenixHBaseAccessor {
   // Ignore
 }
   }
+  if (stmt != null) {
+stmt.close();
+  }
 }
-
-return stmt;
   }
 
   /**
@@ -515,7 +516,7 @@ public class PhoenixHBaseAccessor {
 try {
   //get latest
   if(condition.isPointInTime()) {
-stmt = getLatestAggregateMetricRecords(condition, conn, metrics, 
metricFunctions);
+getLatestAggregateMetricRecords(condition, conn, metrics, 
metricFunctions);
   } else {
 stmt = PhoenixTransactSQL.prepareGetAggregateSqlStmt(conn, condition);
 
@@ -577,7 +578,7 @@ public class PhoenixHBaseAccessor {
 }
   }
 
-  private PreparedStatement getLatestAggregateMetricRecords(Condition 
condition,
+  private void getLatestAggregateMetricRecords(Condition condition,
   Connection conn, TimelineMetrics metrics,
   MapString, ListFunction metricFunctions) throws SQLException {
 
@@ -619,10 +620,11 @@ public class PhoenixHBaseAccessor {
 // Ignore
   }
 }
+if (stmt != null) {
+  stmt.close();
+}
   }
 }
-
-return stmt;
   }
 
   private SingleValuedTimelineMetric 
getAggregateTimelineMetricFromResultSet(ResultSet rs,

http://git-wip-us.apache.org/repos/asf/ambari/blob/2eaac094/ambari-server/src/main/java/org/apache/ambari/eventdb/db/PostgresConnector.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/eventdb/db/PostgresConnector.java
 

[1/2] ambari git commit: AMBARI-6690 - Hosts emit : Host Role Invalid State

2015-06-16 Thread abaranchuk
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 b7d74258f - 2eaac094c


AMBARI-6690 - Hosts emit : Host Role Invalid State


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

Branch: refs/heads/branch-2.1
Commit: 277b93114ad592c905a7149b85bfa76dfdd90902
Parents: b7d7425
Author: Artem Baranchuk abaranc...@hortonworks.con
Authored: Wed Jun 17 01:37:25 2015 +0300
Committer: Artem Baranchuk abaranc...@hortonworks.con
Committed: Wed Jun 17 01:37:25 2015 +0300

--
 .../server/actionmanager/ActionDBAccessor.java  |  2 +-
 .../actionmanager/ActionDBAccessorImpl.java | 13 
 .../server/actionmanager/ActionScheduler.java   | 11 +++
 .../org/apache/ambari/server/state/Cluster.java |  4 +--
 .../server/state/cluster/ClusterImpl.java   | 32 +++-
 5 files changed, 33 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/277b9311/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
index 907c90a..873261f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
@@ -144,7 +144,7 @@ public interface ActionDBAccessor {
   /**
* Bulk abort commands
*/
-  void bulkAbortHostRole(Stage s, ListExecutionCommand commands);
+  void bulkAbortHostRole(Stage s, MapExecutionCommand, String commands);
 
   /**
* Updates scheduled stage.

http://git-wip-us.apache.org/repos/asf/ambari/blob/277b9311/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
index 959ed2d..51b2f09 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
@@ -458,13 +458,12 @@ public class ActionDBAccessorImpl implements 
ActionDBAccessor {
 
   @Override
   public void abortHostRole(String host, long requestId, long stageId, String 
role) {
-String reason = Host Role in invalid state;
+String reason = String.format(On host %s role %s in invalid state., 
host, role);
 abortHostRole(host, requestId, stageId, role, reason);
   }
 
   @Override
-  public void abortHostRole(String host, long requestId, long stageId,
-String role, String reason) {
+  public void abortHostRole(String host, long requestId, long stageId, String 
role, String reason) {
 CommandReport report = new CommandReport();
 report.setExitCode(999);
 report.setStdErr(reason);
@@ -489,9 +488,11 @@ public class ActionDBAccessorImpl implements 
ActionDBAccessor {
 
   @Override
   @Transactional
-  public void bulkAbortHostRole(Stage s, ListExecutionCommand commands) {
-for (ExecutionCommand command : commands) {
-  abortHostRole(command.getHostname(), s.getRequestId(), s.getStageId(), 
command.getRole());
+  public void bulkAbortHostRole(Stage s, MapExecutionCommand, String 
commands) {
+for (ExecutionCommand command : commands.keySet()) {
+  String reason = String.format(On host %s role %s in invalid state.\n%s,
+  command.getHostname(), command.getRole(), commands.get(command));
+  abortHostRole(command.getHostname(), s.getRequestId(), s.getStageId(), 
command.getRole(), reason);
 }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/277b9311/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 8ccf622..562a5ca 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
@@ -335,13 +335,12 @@ class ActionScheduler implements Runnable {
 
 

[1/2] ambari git commit: AMBARI-11965 - Fix high impact Outstanding Security Risks (Dmytro Shkvyra via abaranchuk)

2015-06-16 Thread abaranchuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 9a5edfdea - 94c091e28


AMBARI-11965 - Fix high impact Outstanding Security Risks (Dmytro Shkvyra via 
abaranchuk)


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

Branch: refs/heads/trunk
Commit: 94c091e280a99e07db5f3910873e70aa3c18394f
Parents: 48f785c
Author: Artem Baranchuk abaranc...@hortonworks.con
Authored: Wed Jun 17 01:32:09 2015 +0300
Committer: Artem Baranchuk abaranc...@hortonworks.con
Committed: Wed Jun 17 01:32:26 2015 +0300

--
 .../metrics/timeline/PhoenixHBaseAccessor.java  |  18 +-
 .../ambari/eventdb/db/PostgresConnector.java|  12 +-
 .../ambari/server/agent/HeartBeatHandler.java   |   7 +-
 .../server/api/services/AmbariMetaInfo.java |   4 +-
 .../api/services/serializers/CsvSerializer.java |  23 +-
 .../gsinstaller/ClusterDefinition.java  |  10 +-
 .../controller/jdbc/JDBCResourceProvider.java   |  10 +-
 .../metrics/RestMetricsPropertyProvider.java|   9 +-
 .../ambari/server/orm/DBAccessorImpl.java   | 337 +++
 .../ambari/server/orm/entities/ViewEntity.java  |   1 +
 .../encryption/CredentialStoreServiceImpl.java  |   9 +-
 .../apache/ambari/server/view/ViewRegistry.java |  33 +-
 .../ambari/server/orm/DBAccessorImplTest.java   |   1 -
 .../encryption/CredentialStoreServiceTest.java  |   1 -
 .../ambari/server/view/ViewRegistryTest.java|  14 +-
 .../shell/commands/BlueprintCommands.java   |  13 +-
 16 files changed, 319 insertions(+), 183 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/94c091e2/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
--
diff --git 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
index 8e5d101..d018f29 100644
--- 
a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
+++ 
b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
@@ -396,7 +396,7 @@ public class PhoenixHBaseAccessor {
 try {
   //get latest
   if(condition.isPointInTime()){
-stmt = getLatestMetricRecords(condition, conn, metrics);
+getLatestMetricRecords(condition, conn, metrics);
   } else {
 stmt = PhoenixTransactSQL.prepareGetMetricsSqlStmt(conn, condition);
 rs = stmt.executeQuery();
@@ -465,7 +465,7 @@ public class PhoenixHBaseAccessor {
 }
   }
 
-  private PreparedStatement getLatestMetricRecords(
+  private void getLatestMetricRecords(
 Condition condition, Connection conn, TimelineMetrics metrics)
 throws SQLException, IOException {
 
@@ -490,9 +490,10 @@ public class PhoenixHBaseAccessor {
   // Ignore
 }
   }
+  if (stmt != null) {
+stmt.close();
+  }
 }
-
-return stmt;
   }
 
   /**
@@ -515,7 +516,7 @@ public class PhoenixHBaseAccessor {
 try {
   //get latest
   if(condition.isPointInTime()) {
-stmt = getLatestAggregateMetricRecords(condition, conn, metrics, 
metricFunctions);
+getLatestAggregateMetricRecords(condition, conn, metrics, 
metricFunctions);
   } else {
 stmt = PhoenixTransactSQL.prepareGetAggregateSqlStmt(conn, condition);
 
@@ -577,7 +578,7 @@ public class PhoenixHBaseAccessor {
 }
   }
 
-  private PreparedStatement getLatestAggregateMetricRecords(Condition 
condition,
+  private void getLatestAggregateMetricRecords(Condition condition,
   Connection conn, TimelineMetrics metrics,
   MapString, ListFunction metricFunctions) throws SQLException {
 
@@ -619,10 +620,11 @@ public class PhoenixHBaseAccessor {
 // Ignore
   }
 }
+if (stmt != null) {
+  stmt.close();
+}
   }
 }
-
-return stmt;
   }
 
   private SingleValuedTimelineMetric 
getAggregateTimelineMetricFromResultSet(ResultSet rs,

http://git-wip-us.apache.org/repos/asf/ambari/blob/94c091e2/ambari-server/src/main/java/org/apache/ambari/eventdb/db/PostgresConnector.java
--
diff --git 

[2/2] ambari git commit: AMBARI-6690 - Hosts emit : Host Role Invalid State

2015-06-16 Thread abaranchuk
AMBARI-6690 - Hosts emit : Host Role Invalid State


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

Branch: refs/heads/trunk
Commit: 48f785c23120d1893274e9fc3ba142bd86a63329
Parents: 9a5edfd
Author: Artem Baranchuk abaranc...@hortonworks.con
Authored: Tue Jun 16 02:00:45 2015 +0300
Committer: Artem Baranchuk abaranc...@hortonworks.con
Committed: Wed Jun 17 01:32:26 2015 +0300

--
 .../server/actionmanager/ActionDBAccessor.java  |  2 +-
 .../actionmanager/ActionDBAccessorImpl.java | 13 
 .../server/actionmanager/ActionScheduler.java   | 11 +++
 .../org/apache/ambari/server/state/Cluster.java |  4 +--
 .../server/state/cluster/ClusterImpl.java   | 32 +++-
 5 files changed, 33 insertions(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/48f785c2/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
index 907c90a..873261f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
@@ -144,7 +144,7 @@ public interface ActionDBAccessor {
   /**
* Bulk abort commands
*/
-  void bulkAbortHostRole(Stage s, ListExecutionCommand commands);
+  void bulkAbortHostRole(Stage s, MapExecutionCommand, String commands);
 
   /**
* Updates scheduled stage.

http://git-wip-us.apache.org/repos/asf/ambari/blob/48f785c2/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
index 959ed2d..51b2f09 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
@@ -458,13 +458,12 @@ public class ActionDBAccessorImpl implements 
ActionDBAccessor {
 
   @Override
   public void abortHostRole(String host, long requestId, long stageId, String 
role) {
-String reason = Host Role in invalid state;
+String reason = String.format(On host %s role %s in invalid state., 
host, role);
 abortHostRole(host, requestId, stageId, role, reason);
   }
 
   @Override
-  public void abortHostRole(String host, long requestId, long stageId,
-String role, String reason) {
+  public void abortHostRole(String host, long requestId, long stageId, String 
role, String reason) {
 CommandReport report = new CommandReport();
 report.setExitCode(999);
 report.setStdErr(reason);
@@ -489,9 +488,11 @@ public class ActionDBAccessorImpl implements 
ActionDBAccessor {
 
   @Override
   @Transactional
-  public void bulkAbortHostRole(Stage s, ListExecutionCommand commands) {
-for (ExecutionCommand command : commands) {
-  abortHostRole(command.getHostname(), s.getRequestId(), s.getStageId(), 
command.getRole());
+  public void bulkAbortHostRole(Stage s, MapExecutionCommand, String 
commands) {
+for (ExecutionCommand command : commands.keySet()) {
+  String reason = String.format(On host %s role %s in invalid state.\n%s,
+  command.getHostname(), command.getRole(), commands.get(command));
+  abortHostRole(command.getHostname(), s.getRequestId(), s.getStageId(), 
command.getRole(), reason);
 }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/48f785c2/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 8ccf622..562a5ca 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
@@ -335,13 +335,12 @@ class ActionScheduler implements Runnable {
 
 //Multimap is analog of MapObject, ListObject but allows to avoid 
nested loop
 

ambari git commit: AMBARI-11934. Sanitize YARN metrics.json. (Ivan Kozlov via Jaimin)

2015-06-16 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 1e9b1653c - e3fd54a90


AMBARI-11934. Sanitize YARN metrics.json. (Ivan Kozlov via Jaimin)


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

Branch: refs/heads/branch-2.1
Commit: e3fd54a9030757c3ae2bfd034f18db4255f34f8f
Parents: 1e9b165
Author: Jaimin Jetly jai...@hortonworks.com
Authored: Tue Jun 16 18:39:47 2015 -0700
Committer: Jaimin Jetly jai...@hortonworks.com
Committed: Tue Jun 16 18:39:47 2015 -0700

--
 .../YARN/2.1.0.2.0/YARN_metrics.json| 794 +--
 1 file changed, 742 insertions(+), 52 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e3fd54a9/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
index 9ea1483..79dd883 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
@@ -170,7 +170,7 @@
   temporal: true
 },
 metrics/mapred/ShuffleOutputsFailed: {
-  metric: mapred.ShuffleOutputsFailed,
+  metric: mapred.ShuffleMetrics.ShuffleOutputsFailed,
   pointInTime: true,
   temporal: true
 },
@@ -185,12 +185,12 @@
   temporal: true
 },
 metrics/rpc/rpcAuthorizationFailures: {
-  metric: rpc.metrics.RpcAuthorizationFailures,
+  metric: rpc.rpc.RpcAuthorizationFailures,
   pointInTime: false,
   temporal: true
 },
 metrics/ugi/loginSuccess_avg_time: {
-  metric: ugi.ugi.LoginSuccessAvgTime,
+  metric: ugi.UgiMetrics.LoginSuccessAvgTime,
   pointInTime: false,
   temporal: true
 },
@@ -345,12 +345,12 @@
   temporal: true
 },
 metrics/mapred/ShuffleOutputsOK: {
-  metric: mapred.ShuffleOutputsOK,
+  metric: mapred.ShuffleMetrics.ShuffleOutputsOK,
   pointInTime: true,
   temporal: true
 },
 metrics/ugi/loginSuccess_num_ops: {
-  metric: ugi.ugi.LoginSuccessNumOps,
+  metric: ugi.UgiMetrics.LoginSuccessNumOps,
   pointInTime: false,
   temporal: true
 },
@@ -364,11 +364,6 @@
   pointInTime: false,
   temporal: true
 },
-metrics/cpu/cpu_aidle: {
-  metric: cpu_aidle,
-  pointInTime: true,
-  temporal: true
-},
 metrics/boottime: {
   metric: boottime,
   pointInTime: true,
@@ -395,12 +390,12 @@
   temporal: true
 },
 metrics/ugi/loginFailure_num_ops: {
-  metric: ugi.ugi.LoginFailureNumOps,
+  metric: ugi.UgiMetrics.LoginFailureNumOps,
   pointInTime: false,
   temporal: true
 },
 metrics/mapred/ShuffleConnections: {
-  metric: mapred.ShuffleConnections,
+  metric: mapred.ShuffleMetrics.ShuffleConnections,
   pointInTime: true,
   temporal: true
 },
@@ -410,7 +405,7 @@
   temporal: true
 },
 metrics/ugi/loginFailure_avg_time: {
-  metric: ugi.ugi.LoginFailureAvgTime,
+  metric: ugi.UgiMetrics.LoginFailureAvgTime,
   pointInTime: false,
   temporal: true
 },
@@ -430,19 +425,174 @@
   temporal: true
 },
 metrics/mapred/ShuffleOutputBytes: {
-  metric: mapred.ShuffleOutputBytes,
+  metric: mapred.ShuffleMetrics.ShuffleOutputBytes,
   pointInTime: true,
   temporal: true
 },
 metrics/rpc/rpcAuthenticationSuccesses: {
-  metric: rpc.metrics.RpcAuthenticationSuccesses,
+  metric: rpc.rpc.RpcAuthenticationSuccesses,
   pointInTime: false,
   temporal: true
 },
 metrics/rpc/rpcAuthenticationFailures: {
-  metric: rpc.metrics.RpcAuthenticationFailures,
+  metric: rpc.rpc.RpcAuthenticationFailures,
   pointInTime: false,
   

ambari git commit: AMBARI-11934. Sanitize YARN metrics.json. (Ivan Kozlov via Jaimin)

2015-06-16 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/trunk 983b3cd23 - 043fb9850


AMBARI-11934. Sanitize YARN metrics.json. (Ivan Kozlov via Jaimin)


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

Branch: refs/heads/trunk
Commit: 043fb9850b18be7b7c311e1ad7095a4acebb0cba
Parents: 983b3cd
Author: Jaimin Jetly jai...@hortonworks.com
Authored: Tue Jun 16 18:39:47 2015 -0700
Committer: Jaimin Jetly jai...@hortonworks.com
Committed: Tue Jun 16 18:42:22 2015 -0700

--
 .../YARN/2.1.0.2.0/YARN_metrics.json| 794 +--
 1 file changed, 742 insertions(+), 52 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/043fb985/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
--
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
index 9ea1483..79dd883 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
+++ 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/YARN_metrics.json
@@ -170,7 +170,7 @@
   temporal: true
 },
 metrics/mapred/ShuffleOutputsFailed: {
-  metric: mapred.ShuffleOutputsFailed,
+  metric: mapred.ShuffleMetrics.ShuffleOutputsFailed,
   pointInTime: true,
   temporal: true
 },
@@ -185,12 +185,12 @@
   temporal: true
 },
 metrics/rpc/rpcAuthorizationFailures: {
-  metric: rpc.metrics.RpcAuthorizationFailures,
+  metric: rpc.rpc.RpcAuthorizationFailures,
   pointInTime: false,
   temporal: true
 },
 metrics/ugi/loginSuccess_avg_time: {
-  metric: ugi.ugi.LoginSuccessAvgTime,
+  metric: ugi.UgiMetrics.LoginSuccessAvgTime,
   pointInTime: false,
   temporal: true
 },
@@ -345,12 +345,12 @@
   temporal: true
 },
 metrics/mapred/ShuffleOutputsOK: {
-  metric: mapred.ShuffleOutputsOK,
+  metric: mapred.ShuffleMetrics.ShuffleOutputsOK,
   pointInTime: true,
   temporal: true
 },
 metrics/ugi/loginSuccess_num_ops: {
-  metric: ugi.ugi.LoginSuccessNumOps,
+  metric: ugi.UgiMetrics.LoginSuccessNumOps,
   pointInTime: false,
   temporal: true
 },
@@ -364,11 +364,6 @@
   pointInTime: false,
   temporal: true
 },
-metrics/cpu/cpu_aidle: {
-  metric: cpu_aidle,
-  pointInTime: true,
-  temporal: true
-},
 metrics/boottime: {
   metric: boottime,
   pointInTime: true,
@@ -395,12 +390,12 @@
   temporal: true
 },
 metrics/ugi/loginFailure_num_ops: {
-  metric: ugi.ugi.LoginFailureNumOps,
+  metric: ugi.UgiMetrics.LoginFailureNumOps,
   pointInTime: false,
   temporal: true
 },
 metrics/mapred/ShuffleConnections: {
-  metric: mapred.ShuffleConnections,
+  metric: mapred.ShuffleMetrics.ShuffleConnections,
   pointInTime: true,
   temporal: true
 },
@@ -410,7 +405,7 @@
   temporal: true
 },
 metrics/ugi/loginFailure_avg_time: {
-  metric: ugi.ugi.LoginFailureAvgTime,
+  metric: ugi.UgiMetrics.LoginFailureAvgTime,
   pointInTime: false,
   temporal: true
 },
@@ -430,19 +425,174 @@
   temporal: true
 },
 metrics/mapred/ShuffleOutputBytes: {
-  metric: mapred.ShuffleOutputBytes,
+  metric: mapred.ShuffleMetrics.ShuffleOutputBytes,
   pointInTime: true,
   temporal: true
 },
 metrics/rpc/rpcAuthenticationSuccesses: {
-  metric: rpc.metrics.RpcAuthenticationSuccesses,
+  metric: rpc.rpc.RpcAuthenticationSuccesses,
   pointInTime: false,
   temporal: true
 },
 metrics/rpc/rpcAuthenticationFailures: {
-  metric: rpc.metrics.RpcAuthenticationFailures,
+  metric: rpc.rpc.RpcAuthenticationFailures,
   pointInTime: false,
   temporal: 

ambari git commit: AMBARI-11960: NonRoot: Address ambari-server and ambari-agent non-root issues (jluniya)

2015-06-16 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/trunk 043fb9850 - 360716341


AMBARI-11960: NonRoot: Address ambari-server and ambari-agent non-root issues 
(jluniya)


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

Branch: refs/heads/trunk
Commit: 3607163418c3b16782ec85a4ec146be567c55a7a
Parents: 043fb98
Author: Jayush Luniya jlun...@hortonworks.com
Authored: Tue Jun 16 22:31:52 2015 -0700
Committer: Jayush Luniya jlun...@hortonworks.com
Committed: Tue Jun 16 22:31:52 2015 -0700

--
 .../src/main/python/ambari_commons/os_linux.py  | 21 +++
 .../src/main/python/ambari_commons/os_utils.py  |  4 +-
 .../main/python/ambari_commons/os_windows.py|  4 +-
 .../python/ambari_server/serverConfiguration.py | 11 
 .../main/python/ambari_server/setupSecurity.py  | 39 +++--
 .../custom_actions/scripts/check_host.py| 61 
 .../src/test/python/TestAmbariServer.py | 25 ++--
 7 files changed, 118 insertions(+), 47 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/36071634/ambari-common/src/main/python/ambari_commons/os_linux.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/os_linux.py 
b/ambari-common/src/main/python/ambari_commons/os_linux.py
index 00db872..a64f99a 100644
--- a/ambari-common/src/main/python/ambari_commons/os_linux.py
+++ b/ambari-common/src/main/python/ambari_commons/os_linux.py
@@ -29,6 +29,7 @@ from ambari_commons.logging_utils import print_info_msg, 
print_warning_msg
 
 NR_CHMOD_CMD = 'chmod {0} {1} {2}'
 NR_CHOWN_CMD = 'chown {0} {1} {2}'
+WARN_MSG = Command {0} returned exit code {1} with message: {2}
 
 ULIMIT_CMD = ulimit -n
 
@@ -48,10 +49,15 @@ def os_run_os_command(cmd, env=None, shell=False, cwd=None):
   (stdoutdata, stderrdata) = process.communicate()
   return process.returncode, stdoutdata, stderrdata
 
-def os_change_owner(filePath, user):
-  uid = pwd.getpwnam(user).pw_uid
-  gid = pwd.getpwnam(user).pw_gid
-  os.chown(filePath, uid, gid)
+def os_change_owner(filePath, user, recursive):
+  if recursive:
+params =  -R 
+  else:
+params = 
+  command = NR_CHOWN_CMD.format(params, user, filePath)
+  retcode, out, err = os_run_os_command(command)
+  if retcode != 0:
+print_warning_msg(WARN_MSG.format(command, filePath, err))
 
 def os_is_root():
   '''
@@ -61,7 +67,6 @@ def os_is_root():
   return os.geteuid() == 0
 
 def os_set_file_permissions(file, mod, recursive, user):
-  WARN_MSG = Command {0} returned exit code {1} with message: {2}
   if recursive:
 params =  -R 
   else:
@@ -70,15 +75,11 @@ def os_set_file_permissions(file, mod, recursive, user):
   retcode, out, err = os_run_os_command(command)
   if retcode != 0:
 print_warning_msg(WARN_MSG.format(command, file, err))
-  command = NR_CHOWN_CMD.format(params, user, file)
-  retcode, out, err = os_run_os_command(command)
-  if retcode != 0:
-print_warning_msg(WARN_MSG.format(command, file, err))
+  os_change_owner(file, user, recursive)
 
 def os_set_open_files_limit(maxOpenFiles):
   command = %s %s % (ULIMIT_CMD, str(maxOpenFiles))
   os_run_os_command(command)
 
-
 def os_getpass(prompt):
   return getpass.unix_getpass(prompt)

http://git-wip-us.apache.org/repos/asf/ambari/blob/36071634/ambari-common/src/main/python/ambari_commons/os_utils.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/os_utils.py 
b/ambari-common/src/main/python/ambari_commons/os_utils.py
index d496530..18ef96e 100644
--- a/ambari-common/src/main/python/ambari_commons/os_utils.py
+++ b/ambari-common/src/main/python/ambari_commons/os_utils.py
@@ -109,8 +109,8 @@ def is_root():
   return os_is_root()
 
 # Proxy to the os implementation
-def change_owner(filePath, user):
-  os_change_owner(filePath, user)
+def change_owner(filePath, user, recursive):
+  os_change_owner(filePath, user, recursive)
 
 # Proxy to the os implementation
 def set_open_files_limit(maxOpenFiles):

http://git-wip-us.apache.org/repos/asf/ambari/blob/36071634/ambari-common/src/main/python/ambari_commons/os_windows.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/os_windows.py 
b/ambari-common/src/main/python/ambari_commons/os_windows.py
index 36cb384..a826eef 100644
--- a/ambari-common/src/main/python/ambari_commons/os_windows.py
+++ b/ambari-common/src/main/python/ambari_commons/os_windows.py
@@ -364,8 +364,10 @@ def run_powershell_script(script_content):
   os.remove(script_file.name)
   return 

ambari git commit: AMBARI-11960: NonRoot: Address ambari-server and ambari-agent non-root issues (jluniya)

2015-06-16 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 e3fd54a90 - 778d6c218


AMBARI-11960: NonRoot: Address ambari-server and ambari-agent non-root issues 
(jluniya)


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

Branch: refs/heads/branch-2.1
Commit: 778d6c218239fb00af156b111a1e4b969095ea80
Parents: e3fd54a
Author: Jayush Luniya jlun...@hortonworks.com
Authored: Tue Jun 16 22:31:52 2015 -0700
Committer: Jayush Luniya jlun...@hortonworks.com
Committed: Tue Jun 16 22:32:45 2015 -0700

--
 .../src/main/python/ambari_commons/os_linux.py  | 21 +++
 .../src/main/python/ambari_commons/os_utils.py  |  4 +-
 .../main/python/ambari_commons/os_windows.py|  4 +-
 .../python/ambari_server/serverConfiguration.py | 11 
 .../main/python/ambari_server/setupSecurity.py  | 39 +++--
 .../custom_actions/scripts/check_host.py| 61 
 .../src/test/python/TestAmbariServer.py | 25 ++--
 7 files changed, 118 insertions(+), 47 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/778d6c21/ambari-common/src/main/python/ambari_commons/os_linux.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/os_linux.py 
b/ambari-common/src/main/python/ambari_commons/os_linux.py
index 00db872..a64f99a 100644
--- a/ambari-common/src/main/python/ambari_commons/os_linux.py
+++ b/ambari-common/src/main/python/ambari_commons/os_linux.py
@@ -29,6 +29,7 @@ from ambari_commons.logging_utils import print_info_msg, 
print_warning_msg
 
 NR_CHMOD_CMD = 'chmod {0} {1} {2}'
 NR_CHOWN_CMD = 'chown {0} {1} {2}'
+WARN_MSG = Command {0} returned exit code {1} with message: {2}
 
 ULIMIT_CMD = ulimit -n
 
@@ -48,10 +49,15 @@ def os_run_os_command(cmd, env=None, shell=False, cwd=None):
   (stdoutdata, stderrdata) = process.communicate()
   return process.returncode, stdoutdata, stderrdata
 
-def os_change_owner(filePath, user):
-  uid = pwd.getpwnam(user).pw_uid
-  gid = pwd.getpwnam(user).pw_gid
-  os.chown(filePath, uid, gid)
+def os_change_owner(filePath, user, recursive):
+  if recursive:
+params =  -R 
+  else:
+params = 
+  command = NR_CHOWN_CMD.format(params, user, filePath)
+  retcode, out, err = os_run_os_command(command)
+  if retcode != 0:
+print_warning_msg(WARN_MSG.format(command, filePath, err))
 
 def os_is_root():
   '''
@@ -61,7 +67,6 @@ def os_is_root():
   return os.geteuid() == 0
 
 def os_set_file_permissions(file, mod, recursive, user):
-  WARN_MSG = Command {0} returned exit code {1} with message: {2}
   if recursive:
 params =  -R 
   else:
@@ -70,15 +75,11 @@ def os_set_file_permissions(file, mod, recursive, user):
   retcode, out, err = os_run_os_command(command)
   if retcode != 0:
 print_warning_msg(WARN_MSG.format(command, file, err))
-  command = NR_CHOWN_CMD.format(params, user, file)
-  retcode, out, err = os_run_os_command(command)
-  if retcode != 0:
-print_warning_msg(WARN_MSG.format(command, file, err))
+  os_change_owner(file, user, recursive)
 
 def os_set_open_files_limit(maxOpenFiles):
   command = %s %s % (ULIMIT_CMD, str(maxOpenFiles))
   os_run_os_command(command)
 
-
 def os_getpass(prompt):
   return getpass.unix_getpass(prompt)

http://git-wip-us.apache.org/repos/asf/ambari/blob/778d6c21/ambari-common/src/main/python/ambari_commons/os_utils.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/os_utils.py 
b/ambari-common/src/main/python/ambari_commons/os_utils.py
index d496530..18ef96e 100644
--- a/ambari-common/src/main/python/ambari_commons/os_utils.py
+++ b/ambari-common/src/main/python/ambari_commons/os_utils.py
@@ -109,8 +109,8 @@ def is_root():
   return os_is_root()
 
 # Proxy to the os implementation
-def change_owner(filePath, user):
-  os_change_owner(filePath, user)
+def change_owner(filePath, user, recursive):
+  os_change_owner(filePath, user, recursive)
 
 # Proxy to the os implementation
 def set_open_files_limit(maxOpenFiles):

http://git-wip-us.apache.org/repos/asf/ambari/blob/778d6c21/ambari-common/src/main/python/ambari_commons/os_windows.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/os_windows.py 
b/ambari-common/src/main/python/ambari_commons/os_windows.py
index 36cb384..a826eef 100644
--- a/ambari-common/src/main/python/ambari_commons/os_windows.py
+++ b/ambari-common/src/main/python/ambari_commons/os_windows.py
@@ -364,8 +364,10 @@ def run_powershell_script(script_content):
   os.remove(script_file.name)
   

ambari git commit: AMBARI-10355. Ignore eclipse files in Rat configuration. (Jonathan Halterman via yusaku)

2015-06-16 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 2eaac094c - e387a3839


AMBARI-10355. Ignore eclipse files in Rat configuration. (Jonathan Halterman 
via yusaku)


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

Branch: refs/heads/branch-2.1
Commit: e387a3839a07f9c06375875af93f9c253daa2e7c
Parents: 2eaac09
Author: Yusaku Sako yus...@hortonworks.com
Authored: Tue Jun 16 16:52:27 2015 -0700
Committer: Yusaku Sako yus...@hortonworks.com
Committed: Tue Jun 16 16:53:06 2015 -0700

--
 pom.xml | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e387a383/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 513f780..c698654 100644
--- a/pom.xml
+++ b/pom.xml
@@ -265,6 +265,9 @@
 excludeversion/exclude
 !--IDE and GIT files--
 exclude**/.idea//exclude
+exclude**/.classpath//exclude
+exclude**/.project//exclude
+exclude**/.settings//exclude
 exclude.git//exclude
 exclude.pydevproject/exclude
 exclude**/.gitignore/exclude
@@ -272,12 +275,9 @@
 exclude**/.gitkeep/exclude
 exclude**/.jshintrc/exclude
 exclude**/.editorconfig/exclude
-  !--gitignore content--
+!--gitignore content--
 exclude.DS_Store/exclude
 exclude**/*.iml/exclude
-exclude.classpath/exclude
-exclude.project/exclude
-exclude.settings/exclude
 exclude*.pyc/exclude
 exclude*.py~/exclude
 exclude.hg/exclude



ambari git commit: AMBARI-10355. Ignore eclipse files in Rat configuration. (Jonathan Halterman via yusaku)

2015-06-16 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk 94c091e28 - c9c93c5b9


AMBARI-10355. Ignore eclipse files in Rat configuration. (Jonathan Halterman 
via yusaku)


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

Branch: refs/heads/trunk
Commit: c9c93c5b9462d5e36a584acc51f49358b80b5c01
Parents: 94c091e
Author: Yusaku Sako yus...@hortonworks.com
Authored: Tue Jun 16 16:52:27 2015 -0700
Committer: Yusaku Sako yus...@hortonworks.com
Committed: Tue Jun 16 16:52:27 2015 -0700

--
 pom.xml | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c9c93c5b/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 3972dd0..47eac31 100644
--- a/pom.xml
+++ b/pom.xml
@@ -265,6 +265,9 @@
 excludeversion/exclude
 !--IDE and GIT files--
 exclude**/.idea//exclude
+exclude**/.classpath//exclude
+exclude**/.project//exclude
+exclude**/.settings//exclude
 exclude.git//exclude
 exclude.pydevproject/exclude
 exclude**/.gitignore/exclude
@@ -272,12 +275,9 @@
 exclude**/.gitkeep/exclude
 exclude**/.jshintrc/exclude
 exclude**/.editorconfig/exclude
-  !--gitignore content--
+!--gitignore content--
 exclude.DS_Store/exclude
 exclude**/*.iml/exclude
-exclude.classpath/exclude
-exclude.project/exclude
-exclude.settings/exclude
 exclude*.pyc/exclude
 exclude*.py~/exclude
 exclude.hg/exclude



ambari git commit: AMBARI-11966. Update atlas version associated with HDP 2.3 stack (Jon Maron via smohanty)

2015-06-16 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/trunk c9c93c5b9 - 983b3cd23


AMBARI-11966. Update atlas version associated with HDP 2.3 stack (Jon Maron via 
smohanty)


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

Branch: refs/heads/trunk
Commit: 983b3cd23cbde486b45eeb8903bc375c8a564cac
Parents: c9c93c5
Author: Sumit Mohanty smoha...@hortonworks.com
Authored: Tue Jun 16 17:08:20 2015 -0700
Committer: Sumit Mohanty smoha...@hortonworks.com
Committed: Tue Jun 16 17:08:20 2015 -0700

--
 .../src/main/resources/stacks/HDP/2.3/services/ATLAS/metainfo.xml  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/983b3cd2/ambari-server/src/main/resources/stacks/HDP/2.3/services/ATLAS/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/ATLAS/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/ATLAS/metainfo.xml
index 6f5a9a3..fee10d3 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/ATLAS/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/ATLAS/metainfo.xml
@@ -21,7 +21,7 @@
 service
   nameATLAS/name
   extendscommon-services/ATLAS/0.1.0.2.3/extends
-  version0.1.0.2.3/version
+  version0.5.0.2.3/version
   osSpecifics
 osSpecific
   osFamilyredhat7,redhat6,suse11/osFamily



ambari git commit: AMBARI-11966. Update atlas version associated with HDP 2.3 stack (Jon Maron via smohanty)

2015-06-16 Thread smohanty
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 e387a3839 - 1e9b1653c


AMBARI-11966. Update atlas version associated with HDP 2.3 stack (Jon Maron via 
smohanty)


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

Branch: refs/heads/branch-2.1
Commit: 1e9b1653c061687669108f649b91e40001de6dbe
Parents: e387a38
Author: Sumit Mohanty smoha...@hortonworks.com
Authored: Tue Jun 16 17:08:20 2015 -0700
Committer: Sumit Mohanty smoha...@hortonworks.com
Committed: Tue Jun 16 17:08:56 2015 -0700

--
 .../src/main/resources/stacks/HDP/2.3/services/ATLAS/metainfo.xml  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1e9b1653/ambari-server/src/main/resources/stacks/HDP/2.3/services/ATLAS/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/ATLAS/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/ATLAS/metainfo.xml
index 6f5a9a3..fee10d3 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.3/services/ATLAS/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.3/services/ATLAS/metainfo.xml
@@ -21,7 +21,7 @@
 service
   nameATLAS/name
   extendscommon-services/ATLAS/0.1.0.2.3/extends
-  version0.1.0.2.3/version
+  version0.5.0.2.3/version
   osSpecifics
 osSpecific
   osFamilyredhat7,redhat6,suse11/osFamily



ambari git commit: AMBARI-11936: Remove gzip dependency in Slider view for Windows (jluniya)

2015-06-16 Thread jluniya
Repository: ambari
Updated Branches:
  refs/heads/trunk 296ad04c8 - 9b8b308fe


AMBARI-11936: Remove gzip dependency in Slider view for Windows (jluniya)


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

Branch: refs/heads/trunk
Commit: 9b8b308feba4964511ca0fdbe253cb15ca182223
Parents: 296ad04
Author: Jayush Luniya jlun...@hortonworks.com
Authored: Tue Jun 16 00:18:55 2015 -0700
Committer: Jayush Luniya jlun...@hortonworks.com
Committed: Tue Jun 16 00:18:55 2015 -0700

--
 contrib/views/slider/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9b8b308f/contrib/views/slider/pom.xml
--
diff --git a/contrib/views/slider/pom.xml b/contrib/views/slider/pom.xml
index 5f5df53..e22c55a 100644
--- a/contrib/views/slider/pom.xml
+++ b/contrib/views/slider/pom.xml
@@ -394,7 +394,7 @@
 executable.pythonpython/executable.python
 executable.brunchcmd/executable.brunch
 args.brunch/C brunch/args.brunch
-executable.gzipgzip-content.cmd/executable.gzip
+executable.gzip${project.basedir}\gzip-content.cmd/executable.gzip
 executable.mkdircmd/executable.mkdir
 args.mkdir/C mkdir/args.mkdir
 executable.npmcmd/executable.npm



ambari git commit: AMBARI-11890 [WinTP2] [Test] Cluster install via blueprint fails

2015-06-16 Thread fbarca
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 40de958c1 - 63d89c072


AMBARI-11890 [WinTP2] [Test] Cluster install via blueprint fails

Strengthened the parameter assignments originating from environment vars, to 
handle out-of-order installations


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

Branch: refs/heads/branch-2.1
Commit: 63d89c072d6f621a04776ce09f1cd4483e277ce0
Parents: 40de958
Author: Florian Barca fba...@hortonworks.com
Authored: Tue Jun 16 01:15:52 2015 -0700
Committer: Florian Barca fba...@hortonworks.com
Committed: Tue Jun 16 01:15:52 2015 -0700

--
 .../libraries/functions/install_hdp_msi.py  |  2 +-
 .../HDFS/2.1.0.2.0/package/scripts/datanode.py  |  4 +-
 .../2.1.0.2.0/package/scripts/hdfs_client.py|  5 ++-
 .../2.1.0.2.0/package/scripts/install_params.py | 39 
 .../2.1.0.2.0/package/scripts/journalnode.py|  3 ++
 .../HDFS/2.1.0.2.0/package/scripts/namenode.py  |  5 +++
 .../2.1.0.2.0/package/scripts/params_windows.py |  5 ++-
 .../package/scripts/params_windows.py   | 31 +++-
 .../0.5.0.2.2/package/scripts/params_windows.py | 37 +--
 .../package/scripts/params_windows.py   | 14 +--
 .../package/scripts/params_windows.py   | 19 +++---
 .../0.4.0.2.1/package/scripts/params_windows.py |  7 +++-
 .../3.4.5.2.0/package/scripts/params_windows.py | 14 +--
 13 files changed, 146 insertions(+), 39 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/63d89c07/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
index 0e06eb0..7e94b5d 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
@@ -97,7 +97,7 @@ INSTALL_MSI_CMD = 'cmd /C start /wait msiexec /qn /i  
{hdp_msi_path} /lv {hdp_lo
   'HDP_LAYOUT={hdp_layout_path} DESTROY_DATA=yes 
HDP_USER={hadoop_user} HDP_USER_PASSWORD={hadoop_password_arg} HDP=yes ' \
   'KNOX=yes KNOX_MASTER_SECRET=AmbariHDP2Windows FALCON=yes 
STORM=yes HBase=yes STORM=yes FLUME=yes SLIDER=yes PHOENIX=no RANGER=no'
 CREATE_SERVICE_SCRIPT = os.path.abspath(sbin\createservice.ps1)
-CREATE_SERVICE_CMD = 'cmd /C powershell -File {script} -username {username} 
-password {password} -servicename ' \
+CREATE_SERVICE_CMD = 'cmd /C powershell -ExecutionPolicy Bypass -File 
{script} -username {username} -password {password} -servicename ' \
  '{servicename} -hdpresourcesdir {resourcedir} 
-servicecmdpath {servicecmd}'
 INSTALL_MARKER_OK = msi.installed
 INSTALL_MARKER_FAILED = msi.failed

http://git-wip-us.apache.org/repos/asf/ambari/blob/63d89c07/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
index fc54f73..d8b8835 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
@@ -143,7 +143,9 @@ class DataNodeDefault(DataNode):
 
 @OsFamilyImpl(os_family=OSConst.WINSRV_FAMILY)
 class DataNodeWindows(DataNode):
-  pass
+  def install(self, env):
+import install_params
+self.install_packages(env, install_params.exclude_packages)
 
 if __name__ == __main__:
   DataNode().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/63d89c07/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
index 961e644..dd0dca4 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
@@ -111,7 +111,10 @@ 

ambari git commit: AMBARI-11890 [WinTP2] [Test] Cluster install via blueprint fails

2015-06-16 Thread fbarca
Repository: ambari
Updated Branches:
  refs/heads/trunk 9b8b308fe - 345f99588


AMBARI-11890 [WinTP2] [Test] Cluster install via blueprint fails

Strengthened the parameter assignments originating from environment vars, to 
handle out-of-order installations


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

Branch: refs/heads/trunk
Commit: 345f99588c924b3f9c271cee13ae5e53b3e69261
Parents: 9b8b308
Author: Florian Barca fba...@hortonworks.com
Authored: Tue Jun 16 01:15:03 2015 -0700
Committer: Florian Barca fba...@hortonworks.com
Committed: Tue Jun 16 01:15:03 2015 -0700

--
 .../libraries/functions/install_hdp_msi.py  |  2 +-
 .../HDFS/2.1.0.2.0/package/scripts/datanode.py  |  4 +-
 .../2.1.0.2.0/package/scripts/hdfs_client.py|  5 ++-
 .../2.1.0.2.0/package/scripts/install_params.py | 39 
 .../2.1.0.2.0/package/scripts/journalnode.py|  3 ++
 .../HDFS/2.1.0.2.0/package/scripts/namenode.py  |  5 +++
 .../2.1.0.2.0/package/scripts/params_windows.py |  5 ++-
 .../package/scripts/params_windows.py   | 31 +++-
 .../0.5.0.2.2/package/scripts/params_windows.py | 37 +--
 .../package/scripts/params_windows.py   | 14 +--
 .../package/scripts/params_windows.py   | 19 +++---
 .../0.4.0.2.1/package/scripts/params_windows.py |  7 +++-
 .../3.4.5.2.0/package/scripts/params_windows.py | 14 +--
 13 files changed, 146 insertions(+), 39 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/345f9958/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
index 0e06eb0..7e94b5d 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/install_hdp_msi.py
@@ -97,7 +97,7 @@ INSTALL_MSI_CMD = 'cmd /C start /wait msiexec /qn /i  
{hdp_msi_path} /lv {hdp_lo
   'HDP_LAYOUT={hdp_layout_path} DESTROY_DATA=yes 
HDP_USER={hadoop_user} HDP_USER_PASSWORD={hadoop_password_arg} HDP=yes ' \
   'KNOX=yes KNOX_MASTER_SECRET=AmbariHDP2Windows FALCON=yes 
STORM=yes HBase=yes STORM=yes FLUME=yes SLIDER=yes PHOENIX=no RANGER=no'
 CREATE_SERVICE_SCRIPT = os.path.abspath(sbin\createservice.ps1)
-CREATE_SERVICE_CMD = 'cmd /C powershell -File {script} -username {username} 
-password {password} -servicename ' \
+CREATE_SERVICE_CMD = 'cmd /C powershell -ExecutionPolicy Bypass -File 
{script} -username {username} -password {password} -servicename ' \
  '{servicename} -hdpresourcesdir {resourcedir} 
-servicecmdpath {servicecmd}'
 INSTALL_MARKER_OK = msi.installed
 INSTALL_MARKER_FAILED = msi.failed

http://git-wip-us.apache.org/repos/asf/ambari/blob/345f9958/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
index fc54f73..d8b8835 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/datanode.py
@@ -143,7 +143,9 @@ class DataNodeDefault(DataNode):
 
 @OsFamilyImpl(os_family=OSConst.WINSRV_FAMILY)
 class DataNodeWindows(DataNode):
-  pass
+  def install(self, env):
+import install_params
+self.install_packages(env, install_params.exclude_packages)
 
 if __name__ == __main__:
   DataNode().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/345f9958/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
--
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
index 961e644..dd0dca4 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/hdfs_client.py
@@ -111,7 +111,10 @@ class 

ambari git commit: AMBARI-11943. RU: UI must retry ABORTED upgrades (onechiporenko)

2015-06-16 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk 345f99588 - b508d0396


AMBARI-11943. RU: UI must retry ABORTED upgrades (onechiporenko)


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

Branch: refs/heads/trunk
Commit: b508d0396dd572850c5018a4fcea6865261ac5be
Parents: 345f995
Author: Oleg Nechiporenko onechipore...@apache.org
Authored: Tue Jun 16 12:39:22 2015 +0300
Committer: Oleg Nechiporenko onechipore...@apache.org
Committed: Tue Jun 16 12:39:22 2015 +0300

--
 ambari-web/app/app.js   | 16 ++
 .../main/admin/stack_and_upgrade_controller.js  | 50 +
 ambari-web/app/messages.js  | 11 +++-
 ambari-web/app/styles/application.less  | 17 ++
 ambari-web/app/styles/common.less   | 19 +++
 ambari-web/app/templates/application.hbs| 13 -
 .../stack_upgrade/stack_upgrade_wizard.hbs  | 25 +
 ambari-web/app/utils/ajax/ajax.js   | 14 +
 .../stack_upgrade/upgrade_version_box_view.js   |  8 ++-
 .../admin/stack_upgrade/upgrade_wizard_view.js  |  4 +-
 ambari-web/test/app_test.js | 56 
 .../admin/stack_and_upgrade_controller_test.js  | 48 +
 .../upgrade_version_box_view_test.js| 40 ++
 .../stack_upgrade/upgrade_wizard_view_test.js   | 13 -
 14 files changed, 328 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b508d039/ambari-web/app/app.js
--
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index 23db3a5..0683818 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -66,6 +66,14 @@ module.exports = Em.Application.create({
   }.property('upgradeState'),
 
   /**
+   * flag is true when upgrade process is aborted
+   * @returns {boolean}
+   */
+  upgradeAborted: function() {
+return this.get('upgradeState') === ABORTED;
+  }.property('upgradeState'),
+
+  /**
* RU is running
* @type {boolean}
*/
@@ -74,6 +82,14 @@ module.exports = Em.Application.create({
   }.property('upgradeInProgress', 'upgradeHolding'),
 
   /**
+   * flag is true when upgrade process is running or aborted
+   * @returns {boolean}
+   */
+  upgradeIsNotFinished: function () {
+return this.get('upgradeIsRunning') || this.get('upgradeAborted');
+  }.property('upgradeIsRunning', 'upgradeAborted'),
+
+  /**
* compute user access rights by permission type
* types:
*  - ADMIN

http://git-wip-us.apache.org/repos/asf/ambari/blob/b508d039/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 7768f1c..309ab5e 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
@@ -69,6 +69,10 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
*/
   requestInProgress: false,
   /**
+   * @type {boolean} true while no updated upgrade info is loaded after retry
+   */
+  isRetryPending: false,
+  /**
* properties that stored to localStorage to resume wizard progress
*/
   wizardStorageProperties: ['upgradeId', 'upgradeVersion', 'currentVersion', 
'isDowngrade'],
@@ -207,6 +211,12 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
 if (data.upgrade_groups) {
   this.updateUpgradeData(data);
 }
+if (this.get('isRetryPending')  data.Upgrade.request_status != 
'ABORTED') {
+  this.setProperties({
+requestInProgress: false,
+isRetryPending: false
+  });
+}
   },
 
   /**
@@ -375,6 +385,20 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
 });
   },
 
+  retryUpgrade: function () {
+this.setProperties({
+  requestInProgress: true,
+  isRetryPending: true
+});
+return App.ajax.send({
+  name: 'admin.upgrade.retry',
+  sender: this,
+  data: {
+upgradeId: this.get('upgradeId')
+  }
+});
+  },
+
   /**
* make call to start upgrade process and show popup with current progress
* @param {object} version
@@ -507,6 +531,32 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
 this.set('requestInProgress', false);
   },
 
+  confirmRetryUpgrade: function (version) {
+var 

ambari git commit: AMBARI-11833. Fix Ranger RU for Hive, Knox, Storm; additional fix (Gautam Borad via ncole)

2015-06-16 Thread ncole
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 c84736055 - b270cd6a2


AMBARI-11833. Fix Ranger RU for Hive, Knox, Storm; additional fix (Gautam Borad 
via ncole)


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

Branch: refs/heads/branch-2.1
Commit: b270cd6a291c97d0041818dec4f063027599ca59
Parents: c847360
Author: Nate Cole nc...@hortonworks.com
Authored: Tue Jun 16 06:31:34 2015 -0400
Committer: Nate Cole nc...@hortonworks.com
Committed: Tue Jun 16 06:31:34 2015 -0400

--
 .../src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml| 3 ---
 1 file changed, 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b270cd6a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
index c99469c..d581736 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/upgrades/upgrade-2.3.xml
@@ -398,7 +398,6 @@
 transfer operation=delete delete-key=HTTPS_SERVICE_PORT /
 transfer operation=delete delete-key=HTTP_ENABLED /
 transfer operation=delete delete-key=HTTP_SERVICE_PORT /
-transfer operation=delete delete-key= /
   /task
 
   task xsi:type=configure
@@ -420,13 +419,11 @@
 transfer operation=delete delete-key=logdir /
 transfer operation=delete delete-key=SYNC_SOURCE /
 transfer operation=delete delete-key=POLICY_MGR_URL /
-transfer operation=delete delete-key= /
   /task
 
   task xsi:type=configure
 typeranger-env/type
 transfer operation=delete delete-key=oracle_home /
-transfer operation=delete delete-key= /
   /task
 /pre-upgrade
   



ambari git commit: AMBARI-11943. RU: UI must retry ABORTED upgrades (onechiporenko)

2015-06-16 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 63d89c072 - c84736055


AMBARI-11943. RU: UI must retry ABORTED upgrades (onechiporenko)


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

Branch: refs/heads/branch-2.1
Commit: c847360553d646eaf1d3ade1a43f5a3b5b7204b6
Parents: 63d89c0
Author: Oleg Nechiporenko onechipore...@apache.org
Authored: Tue Jun 16 12:39:22 2015 +0300
Committer: Oleg Nechiporenko onechipore...@apache.org
Committed: Tue Jun 16 12:49:15 2015 +0300

--
 ambari-web/app/app.js   | 16 ++
 .../main/admin/stack_and_upgrade_controller.js  | 50 +
 ambari-web/app/messages.js  | 11 +++-
 ambari-web/app/styles/application.less  | 17 ++
 ambari-web/app/styles/common.less   | 19 +++
 ambari-web/app/templates/application.hbs| 13 -
 .../stack_upgrade/stack_upgrade_wizard.hbs  | 25 +
 ambari-web/app/utils/ajax/ajax.js   | 14 +
 .../stack_upgrade/upgrade_version_box_view.js   |  8 ++-
 .../admin/stack_upgrade/upgrade_wizard_view.js  |  4 +-
 ambari-web/test/app_test.js | 56 
 .../admin/stack_and_upgrade_controller_test.js  | 48 +
 .../upgrade_version_box_view_test.js| 40 ++
 .../stack_upgrade/upgrade_wizard_view_test.js   | 13 -
 14 files changed, 328 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c8473605/ambari-web/app/app.js
--
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index 23db3a5..0683818 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -66,6 +66,14 @@ module.exports = Em.Application.create({
   }.property('upgradeState'),
 
   /**
+   * flag is true when upgrade process is aborted
+   * @returns {boolean}
+   */
+  upgradeAborted: function() {
+return this.get('upgradeState') === ABORTED;
+  }.property('upgradeState'),
+
+  /**
* RU is running
* @type {boolean}
*/
@@ -74,6 +82,14 @@ module.exports = Em.Application.create({
   }.property('upgradeInProgress', 'upgradeHolding'),
 
   /**
+   * flag is true when upgrade process is running or aborted
+   * @returns {boolean}
+   */
+  upgradeIsNotFinished: function () {
+return this.get('upgradeIsRunning') || this.get('upgradeAborted');
+  }.property('upgradeIsRunning', 'upgradeAborted'),
+
+  /**
* compute user access rights by permission type
* types:
*  - ADMIN

http://git-wip-us.apache.org/repos/asf/ambari/blob/c8473605/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 7768f1c..309ab5e 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
@@ -69,6 +69,10 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
*/
   requestInProgress: false,
   /**
+   * @type {boolean} true while no updated upgrade info is loaded after retry
+   */
+  isRetryPending: false,
+  /**
* properties that stored to localStorage to resume wizard progress
*/
   wizardStorageProperties: ['upgradeId', 'upgradeVersion', 'currentVersion', 
'isDowngrade'],
@@ -207,6 +211,12 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
 if (data.upgrade_groups) {
   this.updateUpgradeData(data);
 }
+if (this.get('isRetryPending')  data.Upgrade.request_status != 
'ABORTED') {
+  this.setProperties({
+requestInProgress: false,
+isRetryPending: false
+  });
+}
   },
 
   /**
@@ -375,6 +385,20 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
 });
   },
 
+  retryUpgrade: function () {
+this.setProperties({
+  requestInProgress: true,
+  isRetryPending: true
+});
+return App.ajax.send({
+  name: 'admin.upgrade.retry',
+  sender: this,
+  data: {
+upgradeId: this.get('upgradeId')
+  }
+});
+  },
+
   /**
* make call to start upgrade process and show popup with current progress
* @param {object} version
@@ -507,6 +531,32 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
 this.set('requestInProgress', false);
   },
 
+  confirmRetryUpgrade: function (version) {

ambari git commit: AMBARI-11918 Configs: not enough physical memory warning - not actionable, persistent, and annoying (dsen)

2015-06-16 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/trunk b508d0396 - f84ef816c


AMBARI-11918 Configs: not enough physical memory warning - not actionable, 
persistent, and annoying (dsen)


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

Branch: refs/heads/trunk
Commit: f84ef816c2027bad092c7a33d133ea35c6fb94d1
Parents: b508d03
Author: Dmytro Sen d...@apache.org
Authored: Tue Jun 16 14:28:29 2015 +0300
Committer: Dmytro Sen d...@apache.org
Committed: Tue Jun 16 14:28:29 2015 +0300

--
 .../stacks/HDP/2.0.6/services/stack_advisor.py  | 22 ---
 .../stacks/HDPWIN/2.1/services/stack_advisor.py | 23 +---
 2 files changed, 1 insertion(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f84ef816/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 1c099fd..b48c70a 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -347,28 +347,6 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
 
   def validateClusterConfigurations(self, configurations, services, hosts):
 validationItems = []
-hostComponents = {}
-failureMessage = 
-
-for service in services[services]:
-  for component in service[components]:
-if component[StackServiceComponents][hostnames] is not None:
-  for hostName in component[StackServiceComponents][hostnames]:
-if hostName not in hostComponents.keys():
-  hostComponents[hostName] = []
-
hostComponents[hostName].append(component[StackServiceComponents][component_name])
-
-for host in hosts[items]:
-  if host[Hosts][host_name] in hostComponents:
-# Not enough physical memory
-requiredMemory = 
getMemorySizeRequired(hostComponents[host[Hosts][host_name]], 
configurations)
-if host[Hosts][total_mem] * 1024  requiredMemory:  # in bytes
-  failureMessage += Not enough physical RAM on the host {0}.  \
-At least {1} MB is recommended based on 
components assigned.\n \
-.format(host[Hosts][host_name], requiredMemory/1048576)  # MB
-if failureMessage:
-  notEnoughMemoryItem = self.getWarnItem(failureMessage)
-  validationItems.extend([{config-name: , item: 
notEnoughMemoryItem}])
 
 return self.toConfigurationValidationProblems(validationItems, )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f84ef816/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/stack_advisor.py
index dc64770..b8334e3 100644
--- 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/stack_advisor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/stack_advisor.py
@@ -340,27 +340,6 @@ class HDPWIN21StackAdvisor(DefaultStackAdvisor):
 
   def validateClusterConfigurations(self, configurations, services, hosts):
 validationItems = []
-hostComponents = {}
-failureMessage = 
-
-for service in services[services]:
-  for component in service[components]:
-if component[StackServiceComponents][hostnames] is not None:
-  for hostName in component[StackServiceComponents][hostnames]:
-if hostName not in hostComponents.keys():
-  hostComponents[hostName] = []
-
hostComponents[hostName].append(component[StackServiceComponents][component_name])
-
-for host in hosts[items]:
-  # Not enough physical memory
-  requiredMemory = 
getMemorySizeRequired(hostComponents[host[Hosts][host_name]], 
configurations)
-  if host[Hosts][total_mem] * 1024  requiredMemory:  # in bytes
-failureMessage += Not enough physical RAM on the host {0}.  \
-  At least {1} MB is recommended based on components 
assigned.\n \
-  .format(host[Hosts][host_name], requiredMemory/1048576)  # MB
-if failureMessage:
-  notEnoughMemoryItem = self.getWarnItem(failureMessage)
-  validationItems.extend([{config-name: , item: 
notEnoughMemoryItem}])
 
 return self.toConfigurationValidationProblems(validationItems, )
 
@@ -850,4 

ambari git commit: AMBARI-11918 Configs: not enough physical memory warning - not actionable, persistent, and annoying (dsen)

2015-06-16 Thread dsen
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 b270cd6a2 - a26f98821


AMBARI-11918 Configs: not enough physical memory warning - not actionable, 
persistent, and annoying (dsen)


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

Branch: refs/heads/branch-2.1
Commit: a26f9882189f9c9b531538be69a2e26618004237
Parents: b270cd6
Author: Dmytro Sen d...@apache.org
Authored: Tue Jun 16 14:28:29 2015 +0300
Committer: Dmytro Sen d...@apache.org
Committed: Tue Jun 16 14:30:39 2015 +0300

--
 .../stacks/HDP/2.0.6/services/stack_advisor.py  | 22 ---
 .../stacks/HDPWIN/2.1/services/stack_advisor.py | 23 +---
 2 files changed, 1 insertion(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a26f9882/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index 1c099fd..b48c70a 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -347,28 +347,6 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
 
   def validateClusterConfigurations(self, configurations, services, hosts):
 validationItems = []
-hostComponents = {}
-failureMessage = 
-
-for service in services[services]:
-  for component in service[components]:
-if component[StackServiceComponents][hostnames] is not None:
-  for hostName in component[StackServiceComponents][hostnames]:
-if hostName not in hostComponents.keys():
-  hostComponents[hostName] = []
-
hostComponents[hostName].append(component[StackServiceComponents][component_name])
-
-for host in hosts[items]:
-  if host[Hosts][host_name] in hostComponents:
-# Not enough physical memory
-requiredMemory = 
getMemorySizeRequired(hostComponents[host[Hosts][host_name]], 
configurations)
-if host[Hosts][total_mem] * 1024  requiredMemory:  # in bytes
-  failureMessage += Not enough physical RAM on the host {0}.  \
-At least {1} MB is recommended based on 
components assigned.\n \
-.format(host[Hosts][host_name], requiredMemory/1048576)  # MB
-if failureMessage:
-  notEnoughMemoryItem = self.getWarnItem(failureMessage)
-  validationItems.extend([{config-name: , item: 
notEnoughMemoryItem}])
 
 return self.toConfigurationValidationProblems(validationItems, )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a26f9882/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/stack_advisor.py
index dc64770..b8334e3 100644
--- 
a/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/stack_advisor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDPWIN/2.1/services/stack_advisor.py
@@ -340,27 +340,6 @@ class HDPWIN21StackAdvisor(DefaultStackAdvisor):
 
   def validateClusterConfigurations(self, configurations, services, hosts):
 validationItems = []
-hostComponents = {}
-failureMessage = 
-
-for service in services[services]:
-  for component in service[components]:
-if component[StackServiceComponents][hostnames] is not None:
-  for hostName in component[StackServiceComponents][hostnames]:
-if hostName not in hostComponents.keys():
-  hostComponents[hostName] = []
-
hostComponents[hostName].append(component[StackServiceComponents][component_name])
-
-for host in hosts[items]:
-  # Not enough physical memory
-  requiredMemory = 
getMemorySizeRequired(hostComponents[host[Hosts][host_name]], 
configurations)
-  if host[Hosts][total_mem] * 1024  requiredMemory:  # in bytes
-failureMessage += Not enough physical RAM on the host {0}.  \
-  At least {1} MB is recommended based on components 
assigned.\n \
-  .format(host[Hosts][host_name], requiredMemory/1048576)  # MB
-if failureMessage:
-  notEnoughMemoryItem = self.getWarnItem(failureMessage)
-  validationItems.extend([{config-name: , item: 
notEnoughMemoryItem}])
 
 return self.toConfigurationValidationProblems(validationItems, )