git commit: AMBARI-7106. Use ubuntu12, not debian12 for OS family for ubuntu (dlysnichenko)

2014-09-03 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk d341f7ceb - df34b3a7a


AMBARI-7106. Use ubuntu12, not debian12 for OS family for ubuntu (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: df34b3a7a707cdb4e1ab6838971441425bd1fa22
Parents: d341f7c
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Sep 3 18:18:06 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Sep 3 18:18:06 2014 +0300

--
 .../src/main/python/ambari_agent/HostInfo.py|  2 +-
 .../test/python/ambari_agent/TestHardware.py|  4 +-
 .../resource_management/TestPackageResource.py  |  8 +--
 .../TestRepositoryResource.py   | 16 ++---
 .../src/main/python/ambari_commons/os_check.py  |  8 +--
 .../core/providers/__init__.py  |  2 +-
 .../python/resource_management/core/system.py   |  4 +-
 .../libraries/providers/__init__.py |  4 +-
 .../libraries/providers/monitor_webserver.py|  2 +-
 .../libraries/providers/repository.py   |  2 +-
 ambari-server/pom.xml   |  2 +-
 .../server/api/services/AmbariMetaInfo.java |  2 +-
 .../server/configuration/Configuration.java |  2 +-
 .../org/apache/ambari/server/state/Host.java|  2 +-
 .../server/state/stack/LatestRepoCallable.java  |  2 +-
 .../ambari/server/state/stack/OsFamily.java |  6 +-
 .../src/main/python/ambari_server/utils.py  | 12 ++--
 ambari-server/src/main/python/bootstrap.py  | 14 ++---
 ambari-server/src/main/python/setupAgent.py |  8 +--
 ambari-server/src/main/resources/os_family.json |  2 +-
 .../main/resources/scripts/kerberos-setup.sh|  4 +-
 .../scripts/repo_initialization.py  |  2 +-
 .../before-INSTALL/templates/repo_debian.j2 |  1 -
 .../before-INSTALL/templates/repo_ubuntu.j2 |  1 +
 .../scripts/repo_initialization.py  |  2 +-
 .../before-INSTALL/templates/repo_debian.j2 |  1 -
 .../before-INSTALL/templates/repo_ubuntu.j2 |  1 +
 .../HDP/2.0.6/services/GANGLIA/metainfo.xml |  2 +-
 .../GANGLIA/package/scripts/functions.py|  4 +-
 .../GANGLIA/package/scripts/ganglia_server.py   |  2 +-
 .../services/GANGLIA/package/scripts/params.py  |  4 +-
 .../stacks/HDP/2.0.6/services/HDFS/metainfo.xml |  2 +-
 .../stacks/HDP/2.0.6/services/HIVE/metainfo.xml |  2 +-
 .../services/HIVE/package/scripts/params.py |  2 +-
 .../HIVE/package/scripts/status_params.py   |  2 +-
 .../HDP/2.0.6/services/NAGIOS/metainfo.xml  |  2 +-
 .../services/NAGIOS/package/scripts/nagios.py   |  8 +--
 .../services/NAGIOS/package/scripts/params.py   | 10 +--
 .../NAGIOS/package/templates/nagios.conf.j2 |  2 +-
 .../HDP/2.0.6/services/OOZIE/metainfo.xml   |  2 +-
 .../services/OOZIE/package/files/oozieSmoke2.sh |  2 +-
 .../2.1.GlusterFS/services/OOZIE/metainfo.xml   |  4 +-
 .../resources/stacks/HDP/2.1/repos/repoinfo.xml |  2 +-
 .../stacks/HDP/2.1/services/OOZIE/metainfo.xml  |  2 +-
 .../server/api/services/AmbariMetaInfoTest.java |  1 -
 .../AmbariManagementControllerTest.java |  4 +-
 .../src/test/python/TestAmbariServer.py |  2 +-
 ambari-server/src/test/python/TestBootstrap.py  |  6 +-
 ambari-server/src/test/python/TestOSCheck.py| 12 ++--
 ambari-server/src/test/python/TestSetupAgent.py | 64 ++--
 ambari-server/src/test/python/TestUtils.py  |  6 +-
 .../HDP/2.0.1/services/GANGLIA/metainfo.xml |  2 +-
 .../stacks/HDP/2.0.1/services/HDFS/metainfo.xml |  2 +-
 .../stacks/HDP/2.0.1/services/HIVE/metainfo.xml |  2 +-
 .../HDP/2.0.1/services/OOZIE/metainfo.xml   |  2 +-
 .../HDP/2.0.5/services/GANGLIA/metainfo.xml |  2 +-
 .../stacks/HDP/2.0.5/services/HDFS/metainfo.xml |  2 +-
 .../stacks/HDP/2.0.5/services/HIVE/metainfo.xml |  2 +-
 .../HDP/2.0.5/services/OOZIE/metainfo.xml   |  2 +-
 .../stacks/HDP/2.0.7/services/HIVE/metainfo.xml |  2 +-
 .../assets/data/wizard/stack/HDP_versions.json  | 10 +--
 ambari-web/app/controllers/installer.js |  2 +-
 .../app/controllers/main/admin/repositories.js  |  2 +-
 .../app/controllers/wizard/step3_controller.js  |  2 +-
 .../app/controllers/wizard/step8_controller.js  |  2 +-
 65 files changed, 150 insertions(+), 151 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/df34b3a7/ambari-agent/src/main/python/ambari_agent/HostInfo.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/HostInfo.py 
b/ambari-agent/src/main/python/ambari_agent/HostInfo.py
index ff91dc4..4b7647d 100644
--- 

git commit: AMBARI-7206. ambari - hive-site.xml - use sql standard authorizer, remove this config from commandline (dlysnichenko)

2014-09-08 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk fd4282f61 - a5fdccda4


AMBARI-7206. ambari - hive-site.xml - use sql standard authorizer, remove this 
config from commandline (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: a5fdccda493fbbcd06d0d92b98aac14b0b6f623a
Parents: fd4282f
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Sep 8 21:18:57 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Sep 8 21:18:57 2014 +0300

--
 .../stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml | 2 +-
 .../stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml | 2 +-
 .../2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2   | 2 +-
 .../HDP/2.1.GlusterFS/services/HIVE/configuration/hive-site.xml| 2 +-
 .../stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a5fdccda/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
index 8206a6a..55d960f 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
@@ -115,7 +115,7 @@ limitations under the License.
 
   property
 namehive.security.authorization.manager/name
-valueorg.apache.hcatalog.security.HdfsAuthorizationProvider/value
+
valueorg.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory/value
 descriptionthe hive client authorization manager class name.
   The user defined authorization class should implement interface 
org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider.  
/description
   /property

http://git-wip-us.apache.org/repos/asf/ambari/blob/a5fdccda/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
index 9057fbe..d879a5b 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
@@ -133,7 +133,7 @@ limitations under the License.
 
   property
 namehive.security.authorization.manager/name
-
valueorg.apache.hadoop.hive.ql.security.authorization.StorageBasedAuthorizationProvider/value
+
valueorg.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory/value
 descriptionthe hive client authorization manager class name.
 The user defined authorization class should implement interface 
org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider.  
/description
   /property

http://git-wip-us.apache.org/repos/asf/ambari/blob/a5fdccda/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2
index a8fe21c..3aee116 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2
@@ -22,7 +22,7 @@
 HIVE_SERVER2_OPTS= -hiveconf hive.log.file=hiveserver2.log -hiveconf 
hive.log.dir=$5
 {% if hive_authorization_enabled == True and 
str(hdp_stack_version).startswith('2.1') %}
 # HiveServer 2 -hiveconf options
-HIVE_SERVER2_OPTS=${HIVE_SERVER2_OPTS} -hiveconf 
hive.security.authenticator.manager=org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator
 -hiveconf 
hive.security.authorization.manager=org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory
 

git commit: Revert AMBARI-7206. ambari - hive-site.xml - use sql standard authorizer, remove this config from commandline (dlysnichenko)

2014-09-08 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk a5fdccda4 - 74de327a0


Revert AMBARI-7206. ambari - hive-site.xml - use sql standard authorizer, 
remove this config from commandline (dlysnichenko)

This reverts commit a5fdccda493fbbcd06d0d92b98aac14b0b6f623a.


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

Branch: refs/heads/trunk
Commit: 74de327a0a8dae72c2e5463c7f2295249a68f176
Parents: a5fdccd
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Sep 8 22:02:56 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Sep 8 22:02:56 2014 +0300

--
 .../stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml | 2 +-
 .../stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml | 2 +-
 .../2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2   | 2 +-
 .../HDP/2.1.GlusterFS/services/HIVE/configuration/hive-site.xml| 2 +-
 .../stacks/HDP/2.1/services/HIVE/configuration/hive-site.xml   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/74de327a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
index 55d960f..8206a6a 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
@@ -115,7 +115,7 @@ limitations under the License.
 
   property
 namehive.security.authorization.manager/name
-
valueorg.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory/value
+valueorg.apache.hcatalog.security.HdfsAuthorizationProvider/value
 descriptionthe hive client authorization manager class name.
   The user defined authorization class should implement interface 
org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider.  
/description
   /property

http://git-wip-us.apache.org/repos/asf/ambari/blob/74de327a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
index d879a5b..9057fbe 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
@@ -133,7 +133,7 @@ limitations under the License.
 
   property
 namehive.security.authorization.manager/name
-
valueorg.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory/value
+
valueorg.apache.hadoop.hive.ql.security.authorization.StorageBasedAuthorizationProvider/value
 descriptionthe hive client authorization manager class name.
 The user defined authorization class should implement interface 
org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider.  
/description
   /property

http://git-wip-us.apache.org/repos/asf/ambari/blob/74de327a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2
index 3aee116..a8fe21c 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/templates/startHiveserver2.sh.j2
@@ -22,7 +22,7 @@
 HIVE_SERVER2_OPTS= -hiveconf hive.log.file=hiveserver2.log -hiveconf 
hive.log.dir=$5
 {% if hive_authorization_enabled == True and 
str(hdp_stack_version).startswith('2.1') %}
 # HiveServer 2 -hiveconf options
-HIVE_SERVER2_OPTS=${HIVE_SERVER2_OPTS} -hiveconf 
hive.security.authenticator.manager=org.apache.hadoop.hive.ql.security.SessionStateUserAuthenticator
 
+HIVE_SERVER2_OPTS=${HIVE_SERVER2_OPTS} -hiveconf 

git commit: AMBARI-7218. rename host group deletes configs (dlysnichenko)

2014-09-09 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk daae69eba - 9ce44c953


AMBARI-7218. rename host group deletes configs (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 9ce44c953de1154883887538c5979e5d9036a30c
Parents: daae69e
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Sep 8 21:48:15 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Sep 9 16:16:42 2014 +0300

--
 .../internal/ConfigGroupResourceProvider.java   | 136 ---
 .../ConfigGroupResourceProviderTest.java| 130 ++
 2 files changed, 217 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9ce44c95/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
index 6e13d9c..52df317 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
@@ -383,6 +383,36 @@ public class ConfigGroupResourceProvider extends
 cluster.deleteConfigGroup(request.getId());
   }
 
+  private void basicRequestValidation(ConfigGroupRequest request) {
+if (request.getId() == null
+|| request.getClusterName() == null
+|| request.getClusterName().isEmpty()
+|| request.getGroupName() == null
+|| request.getGroupName().isEmpty()) {
+  LOG.debug(Received a config group request with request id =  +
+  request.getId() + , cluster name =  +
+  request.getClusterName() + , group name =  + 
request.getGroupName());
+  throw new IllegalArgumentException(Request id,  +
+  cluster name and  +
+  group name have to be provided.);
+}
+  }
+
+  private void validateRenameRequest(ConfigGroupRequest request) {
+if (request.getTag() != null
+|| (request.getHosts() != null  ! request.getHosts().isEmpty())
+|| request.getDescription() != null
+|| request.getServiceConfigVersionNote() != null
+|| (request.getConfigs()!=null  ! 
request.getConfigs().isEmpty())) {
+  throw new IllegalArgumentException(Request with id  +
+  request.getId() +
+   seems to be a config group rename request.  +
+  Renaming config group can not be combined with other  +
+  operations, so hosts, configs, description, service config 
version note  +
+  request fields should not be populated.);
+}
+  }
+
   private void validateRequest(ConfigGroupRequest request) {
 if (request.getClusterName() == null
   || request.getClusterName().isEmpty()
@@ -504,81 +534,89 @@ public class ConfigGroupResourceProvider extends
 Clusters clusters = getManagementController().getClusters();
 
 for (ConfigGroupRequest request : requests) {
+  basicRequestValidation(request);
 
   Cluster cluster;
   try {
 cluster = clusters.getCluster(request.getClusterName());
   } catch (ClusterNotFoundException e) {
 throw new ParentObjectNotFoundException(
-  Attempted to add a config group to a cluster which doesn't exist, 
e);
+  String.format(
+The cluster %s does not exist, can not update a config group,
+  request.getClusterName()), e);
   }
 
-  if (request.getId() == null) {
-throw new AmbariException(Config group Id is a required parameter.);
-  }
-
-  validateRequest(request);
-
   // Find config group
-  ConfigGroup configGroup = cluster.getConfigGroups().get(request.getId());
+  MapLong, ConfigGroup configGroups = cluster.getConfigGroups();
+  ConfigGroup configGroup = configGroups.get(request.getId());
   if (configGroup == null) {
 throw new AmbariException(Config group not found
  + , clusterName =  + 
request.getClusterName()
  + , groupId =  + request.getId());
   }
-  String serviceName = configGroup.getServiceName();
-  String requestServiceName = 
cluster.getServiceForConfigTypes(request.getConfigs().keySet());
-  if (serviceName != null  

git commit: Revert AMBARI-7218. rename host group deletes configs (dlysnichenko)

2014-09-10 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 9cf27bf86 - 22b1df064


Revert AMBARI-7218. rename host group deletes configs (dlysnichenko)

This reverts commit 9ce44c953de1154883887538c5979e5d9036a30c.


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

Branch: refs/heads/trunk
Commit: 22b1df06454e32753864ea3a622d9cd5b8d921fa
Parents: 9cf27bf
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Sep 10 13:13:46 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Sep 10 13:13:46 2014 +0300

--
 .../internal/ConfigGroupResourceProvider.java   | 136 +++
 .../ConfigGroupResourceProviderTest.java| 130 --
 2 files changed, 49 insertions(+), 217 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/22b1df06/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
index 52df317..6e13d9c 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java
@@ -383,36 +383,6 @@ public class ConfigGroupResourceProvider extends
 cluster.deleteConfigGroup(request.getId());
   }
 
-  private void basicRequestValidation(ConfigGroupRequest request) {
-if (request.getId() == null
-|| request.getClusterName() == null
-|| request.getClusterName().isEmpty()
-|| request.getGroupName() == null
-|| request.getGroupName().isEmpty()) {
-  LOG.debug(Received a config group request with request id =  +
-  request.getId() + , cluster name =  +
-  request.getClusterName() + , group name =  + 
request.getGroupName());
-  throw new IllegalArgumentException(Request id,  +
-  cluster name and  +
-  group name have to be provided.);
-}
-  }
-
-  private void validateRenameRequest(ConfigGroupRequest request) {
-if (request.getTag() != null
-|| (request.getHosts() != null  ! request.getHosts().isEmpty())
-|| request.getDescription() != null
-|| request.getServiceConfigVersionNote() != null
-|| (request.getConfigs()!=null  ! 
request.getConfigs().isEmpty())) {
-  throw new IllegalArgumentException(Request with id  +
-  request.getId() +
-   seems to be a config group rename request.  +
-  Renaming config group can not be combined with other  +
-  operations, so hosts, configs, description, service config 
version note  +
-  request fields should not be populated.);
-}
-  }
-
   private void validateRequest(ConfigGroupRequest request) {
 if (request.getClusterName() == null
   || request.getClusterName().isEmpty()
@@ -534,87 +504,79 @@ public class ConfigGroupResourceProvider extends
 Clusters clusters = getManagementController().getClusters();
 
 for (ConfigGroupRequest request : requests) {
-  basicRequestValidation(request);
 
   Cluster cluster;
   try {
 cluster = clusters.getCluster(request.getClusterName());
   } catch (ClusterNotFoundException e) {
 throw new ParentObjectNotFoundException(
-  String.format(
-The cluster %s does not exist, can not update a config group,
-  request.getClusterName()), e);
+  Attempted to add a config group to a cluster which doesn't exist, 
e);
   }
 
+  if (request.getId() == null) {
+throw new AmbariException(Config group Id is a required parameter.);
+  }
+
+  validateRequest(request);
+
   // Find config group
-  MapLong, ConfigGroup configGroups = cluster.getConfigGroups();
-  ConfigGroup configGroup = configGroups.get(request.getId());
+  ConfigGroup configGroup = cluster.getConfigGroups().get(request.getId());
   if (configGroup == null) {
 throw new AmbariException(Config group not found
  + , clusterName =  + 
request.getClusterName()
  + , groupId =  + request.getId());
   }
+  String serviceName = configGroup.getServiceName();
+  String requestServiceName = 

git commit: AMBARI-7237. No start action for stopped service in MM mode Stack 1.3 (dlysnichenko)

2014-09-10 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk dc15b7706 - dcc00b69b


AMBARI-7237. No start action for stopped service in MM mode Stack 1.3 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: dcc00b69b3350729123cbf43dd80cf0da314bae6
Parents: dc15b77
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Sep 9 16:50:18 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Sep 10 18:27:21 2014 +0300

--
 .../internal/ServiceResourceProvider.java   |  14 ++-
 .../internal/ServiceResourceProviderTest.java   | 122 ++-
 2 files changed, 133 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc00b69/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
index aec91fd..31c6c37 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
@@ -981,11 +981,13 @@ public class ServiceResourceProvider extends 
AbstractControllerResourceProvider
 State   masterState = null;
 State   clientState = null;
 State   otherState = null;
+State   maxMMState = null; // The worst state among components in 
MM
 
 boolean hasDisabled  = false;
 boolean hasMaster= false;
 boolean hasOther = false;
 boolean hasClient= false;
+boolean hasMM= false;
 
 for (ServiceComponentHostResponse hostComponentResponse : 
hostComponentResponses ) {
   ComponentInfo componentInfo = 
ambariMetaInfo.getComponentCategory(stackId.getStackName(),
@@ -999,10 +1001,17 @@ public class ServiceResourceProvider extends 
AbstractControllerResourceProvider
 boolean isInMaintenance = ! MaintenanceState.OFF.toString().
 equals(hostComponentResponse.getMaintenanceState());
 
-if (state.equals(State.DISABLED) || isInMaintenance) {
+if (state.equals(State.DISABLED)) {
   hasDisabled = true;
 }
 
+if (isInMaintenance  !componentInfo.isClient()) {
+  hasMM = true;
+  if ( maxMMState == null || state.ordinal()  
maxMMState.ordinal()) {
+maxMMState = state;
+  }
+}
+
 if (componentInfo.isMaster()) {
   if (state.equals(State.STARTED) || ! isInMaintenance) {
 // We rely on master's state to determine service state
@@ -1037,7 +1046,8 @@ public class ServiceResourceProvider extends 
AbstractControllerResourceProvider
 return hasMaster   ? masterState == null ? State.STARTED : 
masterState :
hasOther? otherState == null ? State.STARTED : 
otherState :
hasClient   ? clientState == null ? State.INSTALLED : 
clientState :
-   hasDisabled ? State.DISABLED : State.UNKNOWN;
+   hasDisabled ? State.DISABLED :
+   hasMM   ? maxMMState : State.UNKNOWN;
   }
 } catch (AmbariException e) {
   LOG.error(Can't determine service state., e);

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcc00b69/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
index 7dbc38b..05f2e01 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ServiceResourceProviderTest.java
@@ -28,6 +28,7 @@ import static org.easymock.EasyMock.eq;
 import static org.easymock.EasyMock.expect;
 import static org.easymock.EasyMock.isNull;
 import static org.easymock.EasyMock.replay;
+import static 

git commit: AMBARI-7317. Add exclusive flag to custom command/custom action requests (dlysnichenko)

2014-09-16 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 6b2dd66f2 - 645772647


AMBARI-7317. Add exclusive flag to custom command/custom action requests 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 645772647867574620d453ca8b8bb7693a1910eb
Parents: 6b2dd66
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Sep 11 15:08:58 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Sep 16 16:59:21 2014 +0300

--
 .../server/actionmanager/ActionScheduler.java   |  26 +-
 .../ambari/server/actionmanager/Request.java|  23 +-
 .../server/controller/ExecuteActionRequest.java |  20 +-
 .../controller/MaintenanceStateHelper.java  |   2 +-
 .../internal/RequestResourceProvider.java   |  12 +-
 .../server/orm/entities/RequestEntity.java  |  12 +
 .../server/upgrade/UpgradeCatalog170.java   |   4 +
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |   2 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |   2 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql|   2 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql |   2 +-
 .../src/main/resources/properties.json  |   1 +
 .../actionmanager/TestActionDBAccessorImpl.java |   2 +-
 .../actionmanager/TestActionScheduler.java  | 264 ++-
 .../AmbariCustomCommandExecutionHelperTest.java |   2 +-
 .../AmbariManagementControllerTest.java |  86 +++---
 .../BackgroundCustomCommandExecutionTest.java   |   2 +-
 17 files changed, 396 insertions(+), 68 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/64577264/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 0385686..81fee75 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
@@ -217,15 +217,27 @@ class ActionScheduler implements Runnable {
   }
   int i_stage = 0;
   
-  
   stages = filterParallelPerHostStages(stages);
-  
+
+  boolean exclusiveRequestIsGoing = false;
+  // This loop greatly depends on the fact that order of stages in
+  // a list does not change between invocations
   for (Stage s : stages) {
 // Check if we can process this stage in parallel with another stages
 i_stage ++;
-
 long requestId = s.getRequestId();
 LOG.debug(== STAGE_i =  + i_stage + (requestId= + requestId + 
,StageId= + s.getStageId() + ));
+Request request = db.getRequest(requestId);
+
+if (request.isExclusive()) {
+  if (runningRequestIds.size()  0 ) {
+// As a result, we will wait until any previous stages are finished
+LOG.debug(Stage requires exclusive execution, but other requests 
are already executing. Stopping for now);
+break;
+  }
+  exclusiveRequestIsGoing = true;
+}
+
 if (runningRequestIds.contains(requestId)) {
   // We don't want to process different stages from the same request 
in parallel
   LOG.debug(== We don't want to process different stages from the 
same request in parallel );
@@ -238,8 +250,6 @@ class ActionScheduler implements Runnable {
   }
 }
 
-
-
 // Commands that will be scheduled in current scheduler wakeup
 ListExecutionCommand commandsToSchedule = new 
ArrayListExecutionCommand();
 MapString, RoleStats roleStats = processInProgressStage(s, 
commandsToSchedule);
@@ -344,6 +354,12 @@ class ActionScheduler implements Runnable {
 if (! configuration.getParallelStageExecution()) { // If disabled
   return;
 }
+
+if (exclusiveRequestIsGoing) {
+  // As a result, we will prevent any further stages from being 
executed
+  LOG.debug(Stage requires exclusive execution, skipping all 
executing any further stages);
+  break;
+}
   }
 
   requestsInProgress.retainAll(runningRequestIds);

http://git-wip-us.apache.org/repos/asf/ambari/blob/64577264/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/Request.java
--
diff --git 

git commit: AMBARI-7318. ClusterHostInfo host indexes should be hostnames in download client configs (dlysnichenko)

2014-09-17 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk ac290e259 - d6a4a68d0


AMBARI-7318. ClusterHostInfo host indexes should be hostnames in download 
client configs (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: d6a4a68d0fbf0d076b201e4b4d635330dab530b8
Parents: ac290e2
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Sep 17 16:54:31 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Sep 17 16:54:31 2014 +0300

--
 .../internal/ClientConfigResourceProvider.java  | 35 ++--
 .../ClientConfigResourceProviderTest.java   | 24 ++
 2 files changed, 49 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d6a4a68d/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
index 366b5e1..34f4d6f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
@@ -18,7 +18,6 @@
 package org.apache.ambari.server.controller.internal;
 
 import com.google.gson.Gson;
-import com.google.inject.Inject;
 import com.google.inject.assistedinject.Assisted;
 import com.google.inject.assistedinject.AssistedInject;
 import com.google.inject.persist.Transactional;
@@ -213,6 +212,7 @@ public class ClientConfigResourceProvider extends 
AbstractControllerResourceProv
   clusterHostInfo = 
StageUtils.getClusterHostInfo(managementController.getClusters().getHostsForCluster(cluster.getClusterName()),
 cluster);
   serviceInfo = 
managementController.getAmbariMetaInfo().getServiceInfo(stackId.getStackName(),
   stackId.getStackVersion(), serviceName);
+  clusterHostInfo = substituteHostIndexes(clusterHostInfo);
   osFamily = clusters.getHost(hostName).getOsFamily();
 
   TreeMapString, String hostLevelParams = new TreeMapString, String();
@@ -248,11 +248,11 @@ public class ClientConfigResourceProvider extends 
AbstractControllerResourceProv
   }
   String packageList = gson.toJson(packages);
   hostLevelParams.put(PACKAGE_LIST, packageList);
-  
+
   SetString userSet = 
configHelper.getPropertyValuesWithPropertyType(stackId, PropertyType.USER, 
cluster);
   String userList = gson.toJson(userSet);
   hostLevelParams.put(USER_LIST, userList);
-  
+
   SetString groupSet = 
configHelper.getPropertyValuesWithPropertyType(stackId, PropertyType.GROUP, 
cluster);
   String groupList = gson.toJson(groupSet);
   hostLevelParams.put(GROUP_LIST, groupList);
@@ -324,6 +324,35 @@ public class ClientConfigResourceProvider extends 
AbstractControllerResourceProv
 return resources;
   }
 
+  private static MapString, SetString substituteHostIndexes(MapString, 
SetString clusterHostInfo) throws SystemException {
+SetString keysToSkip = new HashSetString(Arrays.asList(all_hosts, 
all_ping_ports,
+ambari_server_host));
+String[] allHosts = {};
+if (clusterHostInfo.get(all_hosts) != null) {
+  allHosts = clusterHostInfo.get(all_hosts).toArray(new 
String[clusterHostInfo.get(all_hosts).size()]);
+}
+SetString keys = clusterHostInfo.keySet();
+for (String key : keys) {
+  if (keysToSkip.contains(key)) {
+continue;
+  }
+  SetString hosts = new HashSetString();
+  SetString currentHostsIndexes = clusterHostInfo.get(key);
+  if (currentHostsIndexes == null) {
+continue;
+  }
+  for (String hostIndex : currentHostsIndexes) {
+try {
+  hosts.add(allHosts[Integer.parseInt(hostIndex)]);
+} catch (ArrayIndexOutOfBoundsException ex) {
+  throw new SystemException(Failed to fill cluster host info  , ex);
+}
+  }
+  clusterHostInfo.put(key, hosts);
+}
+return clusterHostInfo;
+  }
+
   @Override
   public RequestStatus updateResources(final Request request, Predicate 
predicate)
   throws SystemException, UnsupportedPropertyException, 
NoSuchResourceException, NoSuchParentResourceException {


git commit: AMBARI-6400. Extra gmond processes (dlysnichenko)

2014-07-07 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 8ddd85b01 - 931f8aed2


AMBARI-6400. Extra gmond processes (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 931f8aed25c66200cdb1c51b6b9933be7966113b
Parents: 8ddd85b
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Jul 7 18:29:54 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Jul 7 18:29:54 2014 +0300

--
 .../GANGLIA/package/scripts/ganglia_monitor.py  | 106 ++
 ...doop-metrics2-hbase.properties-GANGLIA-RS.j2 |   8 +-
 .../package/templates/hadoop-services.cfg.j2|  25 +--
 .../2.0.6/GANGLIA/test_ganglia_monitor.py   | 193 +--
 4 files changed, 105 insertions(+), 227 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/931f8aed/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
index 695f1cd..96cfdda 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_monitor.py
@@ -75,7 +75,7 @@ class GangliaMonitor(Script):
 )
 
 ganglia.config()
-
+
 self.generate_slave_configs()
 
 Directory(path.join(params.ganglia_dir, conf.d),
@@ -105,99 +105,6 @@ class GangliaMonitor(Script):
   pass
 
 
-  def generate_slave_configs(self):
-import params
-
-if params.is_namenode_master:
-  generate_daemon(gmond,
-  name = HDPNameNode,
-  role = monitor,
-  owner = root,
-  group = params.user_group)
-
-if params.is_jtnode_master:
-  generate_daemon(gmond,
-  name = HDPJobTracker,
-  role = monitor,
-  owner = root,
-  group = params.user_group)
-
-if params.is_rmnode_master:
-  generate_daemon(gmond,
-  name = HDPResourceManager,
-  role = monitor,
-  owner = root,
-  group = params.user_group)
-
-if params.is_hsnode_master:
-  generate_daemon(gmond,
-  name = HDPHistoryServer,
-  role = monitor,
-  owner = root,
-  group = params.user_group)
-
-if params.is_nimbus_host:
-  generate_daemon(gmond,
-  name = HDPNimbus,
-  role = monitor,
-  owner = root,
-  group = params.user_group)
-if params.is_supervisor_host:
-  generate_daemon(gmond,
-  name = HDPSupervisor,
-  role = monitor,
-  owner = root,
-  group = params.user_group)
-
-if params.is_hbase_master:
-  generate_daemon(gmond,
-  name = HDPHBaseMaster,
-  role = monitor,
-  owner = root,
-  group = params.user_group)
-
-generate_daemon(gmond,
-name = HDPSlaves,
-role = monitor,
-owner = root,
-group = params.user_group)
-
-if params.is_slave:
-  generate_daemon(gmond,
-  name = HDPDataNode,
-  role = monitor,
-  owner = root,
-  group = params.user_group)
-
-if params.is_tasktracker:
-  generate_daemon(gmond,
-  name = HDPTaskTracker,
-  role = monitor,
-  owner = root,
-  group = params.user_group)
-
-if params.is_hbase_rs:
-  generate_daemon(gmond,
-  name = HDPHBaseRegionServer,
-  role = monitor,
-  owner = root,
-  group = params.user_group)
-
-if params.is_flume:
-  generate_daemon(gmond,
-  name = HDPFlumeServer,
-  role = monitor,
-  owner = root,
-  group = params.user_group)
-
-if params.is_jn_host:
-  generate_daemon(gmond,
-  

git commit: AMBARI-6403. 2 python-client related tests failed (dlysnichenko)

2014-07-07 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk c0ff6adb4 - 510ff0a6a


AMBARI-6403. 2 python-client related tests failed (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 510ff0a6aeaebb607ad52cde6825bb235ee7033e
Parents: c0ff6ad
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Jul 7 20:32:19 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Jul 7 20:32:19 2014 +0300

--
 .../src/test/python/TestAmbariClient.py | 94 ++--
 .../src/test/python/TestStatusModel.py  | 27 +++---
 ambari-shell/ambari-python-shell/pom.xml| 18 
 3 files changed, 60 insertions(+), 79 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/510ff0a6/ambari-client/python-client/src/test/python/TestAmbariClient.py
--
diff --git a/ambari-client/python-client/src/test/python/TestAmbariClient.py 
b/ambari-client/python-client/src/test/python/TestAmbariClient.py
index 3d78646..0013d1b 100755
--- a/ambari-client/python-client/src/test/python/TestAmbariClient.py
+++ b/ambari-client/python-client/src/test/python/TestAmbariClient.py
@@ -20,7 +20,7 @@ limitations under the License.
 
 
 from mock.mock import MagicMock, patch
-from ambari_client.ambari_api import  AmbariClient 
+from ambari_client.ambari_api import  AmbariClient
 from HttpClientInvoker import HttpClientInvoker
 from ambari_client.model.stack import StackConfigModel, StackComponentModel
 import unittest
@@ -47,166 +47,166 @@ class TestAmbariClient(unittest.TestCase):
 self.assertEqual(client.version, 1, version should be 1)
 self.assertEqual(client.host_url, http://localhost:8080/api/v1;,
host_url should be http://localhost:8080/api/v1;)
-  
+
 client = AmbariClient(host_name=localhost, user_name=admin, 
password=admin)
 self.assertEqual(client.version, 1, version should be 1)
 self.assertEqual(client.host_url, http://localhost:8080/api/v1;,
host_url should be http://localhost:8080/api/v1;)
-  
+
 client = AmbariClient(host_name=localhost)
 self.assertEqual(client.version, 1, version should be 1)
 self.assertEqual(client.host_url, http://localhost:8080/api/v1;,
host_url should be http://localhost:8080/api/v1;)
-
-
+
+
 client = AmbariClient(localhost, 8443, admin, admin, use_https=True)
 self.assertEqual(client.version, 1, version should be 1)
 self.assertEqual(client.host_url, https://localhost:8443/api/v1;,
host_url should be https://localhost:8443/api/v1;)
-  
+
   def test_get_all_clusters(self):
 
 Get all clusters.
 This testcase checks if get_all_clusters returns a list of ModelList.
 
 expected_output = {'items': [{'cluster_name': u'test1', 'version': 
u'HDP-1.2.1'}]}
-  
+
 client = self.create_client()
 all_clusters = client.get_all_clusters()
-  
+
 self.assertEqual(len(all_clusters), 1)
 self.assertEqual(all_clusters.to_json_dict(), expected_output)
-
+
   def test_get_cluster(self):
 
 Get all clusters.
 This testcase checks if get_all_clusters returns a list of ModelList.
 
 expected_dict_output = {'cluster_name': u'test1', 'version': u'HDP-1.2.1'}
-
+
 client = self.create_client()
 cluster = client.get_cluster('test1')
-
+
 self.assertEqual(cluster.cluster_name, test1, cluster_name should be 
test1 )
 self.assertEqual(cluster.to_json_dict(), expected_dict_output, 
to_json_dict should convert ClusterModel)
-
+
   def test_get_host(self):
 
 Get host
 This testcase checks if client.get_host returns a correct host
 
 expected_dict_output = {'ip': '10.0.2.15', 'host_name': 
'dev06.hortonworks.com', 'rack_info': '/default-rack'}
-
+
 client = self.create_client()
 host = client.get_host('dev06.hortonworks.com')
-
+
 self.assertEqual(host.to_json_dict(), expected_dict_output)
 self.assertEqual(host.host_state, HEARTBEAT_LOST)
- 
+
   def test_get_all_hosts(self):
 
 Get all hosts.
 This testcase checks if get_all_hosts returns a list of ModelList.
 
 expected_hosts_dict = {'items': [{'ip': None, 'host_name': u'apspal44-83', 
'rack_info': '/default-rack'}, {'ip': None, 'host_name': u'apspal44-84', 
'rack_info': '/default-rack'}, {'ip': None, 'host_name': u'apspal44-85', 
'rack_info': '/default-rack'}, {'ip': None, 'host_name': u'apspal44-86', 
'rack_info': '/default-rack'}, 

[6/6] git commit: AMBARI-6271. Multiple Stack Service Exceptions When Loading Ambari Server. Fixing regression (dlysnichenko)

2014-07-08 Thread dmitriusan
AMBARI-6271. Multiple Stack Service Exceptions When Loading Ambari Server. 
Fixing regression (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 9c39acb06a12393c1beb6129a61123d82e79f87d
Parents: 97e8119
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Jul 8 17:43:28 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Jul 8 17:44:19 2014 +0300

--
 .../stacks/HDP/2.0.6.GlusterFS/metainfo.xml | 5 +-
 .../services/GANGLIA/configuration/global.xml   |51 -
 .../services/GANGLIA/metainfo.xml   |40 -
 .../services/GLUSTERFS/metainfo.xml |36 +-
 .../services/HBASE/configuration/global.xml |   160 -
 .../HBASE/configuration/hbase-policy.xml|53 -
 .../services/HBASE/configuration/hbase-site.xml |   362 -
 .../2.0.6.GlusterFS/services/HBASE/metainfo.xml |44 -
 .../2.0.6.GlusterFS/services/HBASE/metrics.json | 13635 -
 .../services/HCATALOG/metainfo.xml  |30 -
 .../2.0.6.GlusterFS/services/HDFS/metainfo.xml  |64 +-
 .../services/HIVE/configuration/hive-site.xml   |   261 -
 .../2.0.6.GlusterFS/services/HIVE/metainfo.xml  |45 -
 .../configuration/container-executor.cfg|20 -
 .../MAPREDUCE2/configuration/core-site.xml  |20 -
 .../MAPREDUCE2/configuration/global.xml |44 -
 .../configuration/mapred-queue-acls.xml |39 -
 .../MAPREDUCE2/configuration/mapred-site.xml|   381 -
 .../services/MAPREDUCE2/metainfo.xml|37 -
 .../services/MAPREDUCE2/metrics.json|   383 -
 .../services/NAGIOS/configuration/global.xml|51 -
 .../services/NAGIOS/metainfo.xml|34 -
 .../services/OOZIE/configuration/oozie-site.xml |   313 -
 .../2.0.6.GlusterFS/services/OOZIE/metainfo.xml |38 -
 .../services/PIG/configuration/pig.properties   |52 -
 .../2.0.6.GlusterFS/services/PIG/metainfo.xml   |30 -
 .../2.0.6.GlusterFS/services/SQOOP/metainfo.xml |30 -
 .../services/WEBHCAT/configuration/global.xml   |51 -
 .../WEBHCAT/configuration/webhcat-site.xml  |   126 -
 .../services/WEBHCAT/metainfo.xml   |35 -
 .../YARN/configuration/capacity-scheduler.xml   |   128 -
 .../YARN/configuration/container-executor.cfg   |20 -
 .../services/YARN/configuration/core-site.xml   |20 -
 .../services/YARN/configuration/global.xml  |64 -
 .../services/YARN/configuration/yarn-site.xml   |   326 -
 .../2.0.6.GlusterFS/services/YARN/metainfo.xml  |42 -
 .../2.0.6.GlusterFS/services/YARN/metrics.json  |  2534 ---
 .../services/ZOOKEEPER/configuration/global.xml |75 -
 .../services/ZOOKEEPER/metainfo.xml |39 -
 39 files changed, 56 insertions(+), 19662 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9c39acb0/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/metainfo.xml
index 45a63e5..e1b0ec9 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/metainfo.xml
@@ -16,7 +16,8 @@
limitations under the License.
 --
 metainfo
-versions
+  versions
  activefalse/active
-/versions
+  /versions
+  extends2.0.6/extends
 /metainfo

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c39acb0/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/GANGLIA/configuration/global.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/GANGLIA/configuration/global.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/GANGLIA/configuration/global.xml
deleted file mode 100644
index 18eae57..000
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/GANGLIA/configuration/global.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-?xml version=1.0?
-?xml-stylesheet type=text/xsl href=configuration.xsl?
-!--
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * License); you may not use this file 

[3/6] AMBARI-6271. Multiple Stack Service Exceptions When Loading Ambari Server. Fixing regression (dlysnichenko)

2014-07-08 Thread dmitriusan
http://git-wip-us.apache.org/repos/asf/ambari/blob/9c39acb0/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/YARN/configuration/capacity-scheduler.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/YARN/configuration/capacity-scheduler.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/YARN/configuration/capacity-scheduler.xml
deleted file mode 100644
index 4a19779..000
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/YARN/configuration/capacity-scheduler.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-!--
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the License); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an AS IS BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
---
-
-configuration
-
-  property
-nameyarn.scheduler.capacity.maximum-applications/name
-value1/value
-description
-  Maximum number of applications that can be pending and running.
-/description
-  /property
-
-  property
-nameyarn.scheduler.capacity.maximum-am-resource-percent/name
-value0.2/value
-description
-  Maximum percent of resources in the cluster which can be used to run 
-  application masters i.e. controls number of concurrent running
-  applications.
-/description
-  /property
-
-  property
-nameyarn.scheduler.capacity.root.queues/name
-valuedefault/value
-description
-  The queues at the this level (root is the root queue).
-/description
-  /property
-
-  property
-nameyarn.scheduler.capacity.root.capacity/name
-value100/value
-description
-  The total capacity as a percentage out of 100 for this queue.
-  If it has child queues then this includes their capacity as well.
-  The child queues capacity should add up to their parent queue's capacity
-  or less.
-/description
-  /property
-
-  property
-nameyarn.scheduler.capacity.root.default.capacity/name
-value100/value
-descriptionDefault queue target capacity./description
-  /property
-
-  property
-nameyarn.scheduler.capacity.root.default.user-limit-factor/name
-value1/value
-description
-  Default queue user limit a percentage from 0.0 to 1.0.
-/description
-  /property
-
-  property
-nameyarn.scheduler.capacity.root.default.maximum-capacity/name
-value100/value
-description
-  The maximum capacity of the default queue. 
-/description
-  /property
-
-  property
-nameyarn.scheduler.capacity.root.default.state/name
-valueRUNNING/value
-description
-  The state of the default queue. State can be one of RUNNING or STOPPED.
-/description
-  /property
-
-  property
-nameyarn.scheduler.capacity.root.default.acl_submit_jobs/name
-value*/value
-description
-  The ACL of who can submit jobs to the default queue.
-/description
-  /property
-
-  property
-nameyarn.scheduler.capacity.root.default.acl_administer_jobs/name
-value*/value
-description
-  The ACL of who can administer jobs on the default queue.
-/description
-  /property
-
-  property
-nameyarn.scheduler.capacity.root.acl_administer_queues/name
-value*/value
-description
-  The ACL for who can administer this queue i.e. change sub-queue 
-  allocations.
-/description
-  /property
-  
-  property
-nameyarn.scheduler.capacity.root.unfunded.capacity/name
-value50/value
-description
-  No description
-/description
-  /property
-  property
-nameyarn.scheduler.capacity.node-locality-delay/name
-value40/value
-description
-  No description
-/description
-  /property
-
-
-/configuration

http://git-wip-us.apache.org/repos/asf/ambari/blob/9c39acb0/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/YARN/configuration/container-executor.cfg
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/YARN/configuration/container-executor.cfg
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/YARN/configuration/container-executor.cfg
deleted file mode 100644
index d07b3db..000
--- 

git commit: AMBARI-6422. Failing ambari-server tests on trunk (dlysnichenko)

2014-07-09 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 4a2498ea3 - 5bb59403f


AMBARI-6422. Failing ambari-server tests on trunk (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 5bb59403fea8de54690f6f19a30df5462c99f784
Parents: 4a2498e
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Jul 8 20:22:49 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Jul 9 14:43:23 2014 +0300

--
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java   | 2 ++
 .../apache/ambari/server/api/util/StackExtensionHelperTest.java| 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/5bb59403/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
index 50087e5..d75ef85 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java
@@ -71,6 +71,8 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog 
{
   String.class, 255, null, true));
 dbAccessor.addColumn(viewparameter, new DBAccessor.DBColumnInfo(masked,
   Character.class, 1, null, true));
+dbAccessor.addColumn(users, new DBAccessor.DBColumnInfo(active,
+  Integer.class, 1, 1, false));
   }
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/5bb59403/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
index 6456860..79745bb 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
@@ -77,7 +77,7 @@ public class StackExtensionHelperTest {
 assertEquals(MASTER, components.get(0).getCategory());
 ListPropertyInfo properties = serviceInfo.getProperties();
 // Check some property
-assertEquals(38, properties.size());
+assertEquals(37, properties.size());
 boolean found = false;
 for (PropertyInfo property : properties) {
   if 
(property.getName().equals(javax.jdo.option.ConnectionDriverName)) {



git commit: AMBARI-4338 Proper error message required for CSRF protection error (mpapirkovskyy via dlysnichenko)

2014-07-16 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 81dae66ea - d84b2f57b


AMBARI-4338 Proper error message required for CSRF protection error 
(mpapirkovskyy via dlysnichenko)


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

Branch: refs/heads/trunk
Commit: d84b2f57b532c8f6361b5d807dd375aa4280b44b
Parents: 81dae66
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Jul 16 16:30:03 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Jul 16 16:30:03 2014 +0300

--
 .../server/api/AmbariCsrfProtectionFilter.java  | 58 +
 .../ambari/server/controller/AmbariServer.java  |  4 +-
 .../api/AmbariCsrfProtectionFilterTest.java | 66 
 3 files changed, 126 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d84b2f57/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariCsrfProtectionFilter.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariCsrfProtectionFilter.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariCsrfProtectionFilter.java
new file mode 100644
index 000..2325337
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/AmbariCsrfProtectionFilter.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ambari.server.api;
+
+import com.sun.jersey.spi.container.ContainerRequest;
+import com.sun.jersey.spi.container.ContainerRequestFilter;
+import org.apache.ambari.server.api.services.ResultStatus;
+import org.apache.ambari.server.api.services.serializers.JsonSerializer;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public class AmbariCsrfProtectionFilter implements ContainerRequestFilter {
+  private static final SetString IGNORED_METHODS;
+  private static final String CSRF_HEADER = X-Requested-By;
+  private static final String ERROR_MESSAGE = CSRF protection is turned on.  
+ CSRF_HEADER +  HTTP header is required.;
+  private static final JsonSerializer JSON_SERIALIZER = new JsonSerializer();
+
+  static {
+HashSetString methods = new HashSetString();
+methods.add(GET);
+methods.add(OPTIONS);
+methods.add(HEAD);
+
+IGNORED_METHODS = Collections.unmodifiableSet(methods);
+
+  }
+
+  @Override
+  public ContainerRequest filter(ContainerRequest containerRequest) {
+if (!IGNORED_METHODS.contains(containerRequest.getMethod()) 
+!containerRequest.getRequestHeaders().containsKey(CSRF_HEADER)) {
+  throw new 
WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity(
+  JSON_SERIALIZER.serializeError(new 
ResultStatus(ResultStatus.STATUS.BAD_REQUEST, ERROR_MESSAGE))
+  ).type(MediaType.TEXT_PLAIN_TYPE).build());
+}
+return containerRequest;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/d84b2f57/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
index a515ec6..d71cb8c 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
@@ -346,9 +346,9 @@ public class AmbariServer {
 
   if (configs.csrfProtectionEnabled()) {
 
sh.setInitParameter(com.sun.jersey.spi.container.ContainerRequestFilters,
-

git commit: AMBARI-6610. Ambari POM Version not updated on release (dlysnichenko)

2014-07-25 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 5399843e4 - ebfd77fd5


AMBARI-6610. Ambari POM Version not updated on release (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: ebfd77fd50b3bf40471c6f298420fe9e5eb2fa76
Parents: 5399843
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Jul 25 17:26:50 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Jul 25 17:26:50 2014 +0300

--
 contrib/views/pom.xml| 5 -
 contrib/views/slider/pom.xml | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ebfd77fd/contrib/views/pom.xml
--
diff --git a/contrib/views/pom.xml b/contrib/views/pom.xml
index 363ff0e..1a9c097 100644
--- a/contrib/views/pom.xml
+++ b/contrib/views/pom.xml
@@ -22,6 +22,9 @@
   packagingpom/packaging
   version0.1.0-SNAPSHOT/version
   nameAmbari Contrib Views/name
+  properties
+ambari.version1.3.0-SNAPSHOT/ambari.version
+  /properties
   modules
 modulefiles/module
 modulepig/module
@@ -118,7 +121,7 @@
   dependency
 groupIdorg.apache.ambari/groupId
 artifactIdambari-views/artifactId
-version[1.5.0.1,)/version
+version[${ambari.version},)/version
   /dependency
 /dependencies
   /dependencyManagement

http://git-wip-us.apache.org/repos/asf/ambari/blob/ebfd77fd/contrib/views/slider/pom.xml
--
diff --git a/contrib/views/slider/pom.xml b/contrib/views/slider/pom.xml
index f2279d1..9f66554 100644
--- a/contrib/views/slider/pom.xml
+++ b/contrib/views/slider/pom.xml
@@ -369,7 +369,8 @@
nodejs.directory${basedir}/target/nodejs/nodejs.directory
npm.version1.4.3/npm.version
ui.directory${basedir}/src/main/resources/ui/ui.directory
-   ambari.version1.3.0-SNAPSHOT/ambari.version
+   !-- deprecated, moved to top component --
+   !-- ambari.version1.3.0-SNAPSHOT/ambari.version --
hadoop.version2.4.0/hadoop.version
avro.version1.7.4/avro.version
bigtop.version0.7.0/bigtop.version



git commit: AMBARI-6641. Restart command fails on HDP-1.3.2 stack (dlysnichenko)

2014-07-28 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk f3fa480cc - bf41b50a9


AMBARI-6641. Restart command fails on HDP-1.3.2 stack (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: bf41b50a97638733005011bb21aa78cacdf1afa5
Parents: f3fa480
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Jul 28 21:19:59 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Jul 28 21:19:59 2014 +0300

--
 .../stacks/HDP/1.3.2/services/HDFS/package/scripts/hdfs.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/bf41b50a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/scripts/hdfs.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/scripts/hdfs.py
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/scripts/hdfs.py
index 69009ca..9985e32 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/scripts/hdfs.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/scripts/hdfs.py
@@ -45,7 +45,7 @@ def hdfs(name=None):
 XmlConfig(hadoop-policy.xml,
   conf_dir=params.hadoop_conf_dir,
   configurations=params.config['configurations']['hadoop-policy'],
-  
configuration_attributes=params.config['configuration_attributes']['hadoop_policy'],
+  
configuration_attributes=params.config['configuration_attributes']['hadoop-policy'],
   owner=params.hdfs_user,
   group=params.user_group
 )



git commit: AMBARI-6748. Nimbus start failed after deployment (dlysnichenko)

2014-08-05 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk d70da2c85 - 24be62564


AMBARI-6748. Nimbus start failed after deployment (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 24be62564c80426d4c15b24d596113ca3ce6cd12
Parents: d70da2c
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Aug 5 22:03:58 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Aug 5 22:03:58 2014 +0300

--
 ambari-agent/pom.xml|  2 +-
 .../2.1/services/STORM/package/scripts/storm.py |  2 +-
 .../stacks/2.1/STORM/test_storm_drpc_server.py  | 41 ++--
 .../stacks/2.1/STORM/test_storm_nimbus.py   | 16 
 .../stacks/2.1/STORM/test_storm_nimbus_prod.py  | 16 
 .../2.1/STORM/test_storm_rest_api_service.py| 16 
 .../stacks/2.1/STORM/test_storm_supervisor.py   | 16 
 .../2.1/STORM/test_storm_supervisor_prod.py | 16 
 .../stacks/2.1/STORM/test_storm_ui_server.py| 16 
 9 files changed, 71 insertions(+), 70 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/24be6256/ambari-agent/pom.xml
--
diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index b3bcc25..c98af34 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -114,7 +114,7 @@
 argumentunitTests.py/argument
   /arguments
   environmentVariables
-
PYTHONPATH${project.basedir}/../ambari-common/src/main/python/jinja2:${project.basedir}/../ambari-common/src/main/python/ambari_commons:${project.basedir}/../ambari-common/src/main/python/resource_management:${project.basedir}/../ambari-common/src/test/python:${project.basedir}/../ambari-common/src/main/python:${project.basedir}/src/main/python/ambari_agent:${project.basedir}/src/test/python/ambari_agent:${project.basedir}/src/main/python:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/files:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/files:$PYTHONPATH/PYTHONPATH
+
PYTHONPATH${project.basedir}/../ambari-common/src/main/python/jinja2:${project.basedir}/../ambari-common/src/main/python/ambari_commons:${project.basedir}/../ambari-common/src/main/python/resource_management:${project.basedir}/../ambari-common/src/test/python:${project.basedir}/../ambari-common/src/main/python:${project.basedir}/src/main/python/ambari_agent:${project.basedir}/src/test/python/ambari_agent:${project.basedir}/src/test/python/resource_management:${project.basedir}/src/main/python:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/files:${project.basedir}/../ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/files:$PYTHONPATH/PYTHONPATH
   /environmentVariables
   skip${skipTests}/skip
 /configuration

http://git-wip-us.apache.org/repos/asf/ambari/blob/24be6256/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/storm.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/storm.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/storm.py
index fd9eb23..5fe2cf4 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/storm.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/storm.py
@@ -47,7 +47,7 @@ def storm():
 
   File(format({conf_dir}/storm-env.sh),
 owner=params.storm_user,
-content=params.storm_env_sh_template
+content=InlineTemplate(params.storm_env_sh_template)
   )
 
   if params.security_enabled:

http://git-wip-us.apache.org/repos/asf/ambari/blob/24be6256/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py 
b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
index 92b8dd5..c07ce72 100644
--- a/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/STORM/test_storm_drpc_server.py
@@ -23,24 +23,26 @@ from stacks.utils.RMFTestCase import *
 import  resource_management.core.source
 
 @patch.object(resource_management.core.source, 

git commit: AMBARI-6608. Ambari server should inform the agent whether to use two-way ssl when registering (dlysnichenko)

2014-08-06 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk c2568ef26 - 92c4d45f6


AMBARI-6608. Ambari server should inform the agent whether to use two-way ssl 
when registering (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 92c4d45f6ef69e2bdcc21fae4e5e5766fbba68db
Parents: c2568ef
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Aug 6 21:53:21 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Aug 6 21:56:02 2014 +0300

--
 .../main/python/ambari_agent/AmbariConfig.py| 106 ++-
 .../src/main/python/ambari_agent/Controller.py  |  83 +++
 .../ambari_agent/CustomServiceOrchestrator.py   |   6 +-
 .../src/main/python/ambari_agent/Heartbeat.py   |  20 ++--
 .../src/main/python/ambari_agent/HostCleanup.py |   9 +-
 .../src/main/python/ambari_agent/HostInfo.py|   3 +-
 .../src/main/python/ambari_agent/NetUtil.py |  55 +-
 .../src/main/python/ambari_agent/Register.py|  11 +-
 .../src/main/python/ambari_agent/hostname.py|  16 +--
 .../src/main/python/ambari_agent/main.py|  35 +++---
 .../src/main/python/ambari_agent/security.py|  88 +++
 .../test/python/ambari_agent/TestActionQueue.py |   6 +-
 .../python/ambari_agent/TestCertGeneration.py   |  10 +-
 .../test/python/ambari_agent/TestController.py  |   3 +-
 .../test/python/ambari_agent/TestHostname.py|  22 ++--
 .../src/test/python/ambari_agent/TestMain.py|   4 +-
 .../src/test/python/ambari_agent/TestNetUtil.py |  16 ++-
 .../test/python/ambari_agent/TestSecurity.py|   2 +-
 .../ambari/server/controller/AmbariServer.java  |  22 +---
 .../ambari/server/security/SecurityFilter.java  |   4 +
 .../security/unsecured/rest/ConnectionInfo.java |  54 ++
 .../server/security/CertGenerationTest.java |   2 +-
 22 files changed, 347 insertions(+), 230 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/92c4d45f/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py 
b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
index 688dc74..4330eb3 100644
--- a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
+++ b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
@@ -20,8 +20,9 @@ limitations under the License.
 
 import ConfigParser
 import StringIO
+import json
+from NetUtil import NetUtil
 
-config = ConfigParser.RawConfigParser()
 content = 
 
 [server]
@@ -58,8 +59,6 @@ 
rpms=glusterfs,openssl,wget,net-snmp,ntpd,ganglia,nagios,glusterfs
 log_lines_count=300
 
 
-s = StringIO.StringIO(content)
-config.readfp(s)
 
 imports = [
   hdp/manifests/*.pp,
@@ -145,7 +144,7 @@ serviceStates = {
 }
 
 servicesToPidNames = {
-  'GLUSTERFS' : 'glusterd.pid$',
+  'GLUSTERFS' : 'glusterd.pid$',
   'NAMENODE': 'hadoop-{USER}-namenode.pid$',
   'SECONDARY_NAMENODE': 'hadoop-{USER}-secondarynamenode.pid$',
   'DATANODE': 'hadoop-{USER}-datanode.pid$',
@@ -192,43 +191,65 @@ servicesToLinuxUser = {
 
 pidPathesVars = [
   {'var' : 'glusterfs_pid_dir_prefix',
-   'defaultValue' : '/var/run'},  
+   'defaultValue' : '/var/run'},
   {'var' : 'hadoop_pid_dir_prefix',
'defaultValue' : '/var/run/hadoop'},
   {'var' : 'hadoop_pid_dir_prefix',
-   'defaultValue' : '/var/run/hadoop'}, 
+   'defaultValue' : '/var/run/hadoop'},
   {'var' : 'ganglia_runtime_dir',
-   'defaultValue' : '/var/run/ganglia/hdp'}, 
+   'defaultValue' : '/var/run/ganglia/hdp'},
   {'var' : 'hbase_pid_dir',
-   'defaultValue' : '/var/run/hbase'},
+   'defaultValue' : '/var/run/hbase'},
   {'var' : '',
-   'defaultValue' : '/var/run/nagios'},
+   'defaultValue' : '/var/run/nagios'},
   {'var' : 'zk_pid_dir',
-   'defaultValue' : '/var/run/zookeeper'}, 
+   'defaultValue' : '/var/run/zookeeper'},
   {'var' : 'oozie_pid_dir',
-   'defaultValue' : '/var/run/oozie'}, 
+   'defaultValue' : '/var/run/oozie'},
   {'var' : 'hcat_pid_dir',
-   'defaultValue' : '/var/run/webhcat'},   
+   'defaultValue' : '/var/run/webhcat'},
   {'var' : 'hive_pid_dir',
-   'defaultValue' : '/var/run/hive'},  
+   'defaultValue' : '/var/run/hive'},
   {'var' : 'mysqld_pid_dir',
'defaultValue' : '/var/run/mysqld'},
   {'var' : 'hcat_pid_dir',
-   'defaultValue' : '/var/run/webhcat'},  
+   'defaultValue' : '/var/run/webhcat'},
   {'var' : 'yarn_pid_dir_prefix',

git commit: AMBARI-6760. Server-side implementation of Cancel requests (dlysnichenko)

2014-08-07 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 5bcd37529 - 7c0bab119


AMBARI-6760. Server-side implementation of Cancel requests (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 7c0bab1197b5685f86c39a81372d44f8f8648451
Parents: 5bcd375
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Aug 5 16:47:44 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Aug 7 17:33:50 2014 +0300

--
 .../actionmanager/ActionDBAccessorImpl.java |   6 +-
 .../server/actionmanager/ActionManager.java |  26 ++-
 .../server/actionmanager/ActionScheduler.java   | 167 ---
 .../server/actionmanager/HostRoleStatus.java|   4 +-
 .../ambari/server/actionmanager/Request.java|  13 ++
 .../ambari/server/agent/AgentCommand.java   |   1 +
 .../ambari/server/agent/CancelCommand.java  |  55 ++
 .../ambari/server/agent/HeartBeatHandler.java   |  25 ++-
 .../ambari/server/agent/HeartBeatResponse.java  |  16 ++
 .../server/controller/ControllerModule.java |   2 +-
 .../internal/RequestResourceProvider.java   |   7 +-
 .../actionmanager/TestActionDBAccessorImpl.java |   2 +-
 .../server/actionmanager/TestActionManager.java |   4 +-
 .../actionmanager/TestActionScheduler.java  |   8 +-
 .../server/agent/TestHeartbeatHandler.java  |  13 +-
 15 files changed, 263 insertions(+), 86 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7c0bab11/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 1ba6b94..dae9048 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
@@ -350,7 +350,11 @@ public class ActionDBAccessorImpl implements 
ActionDBAccessor {
 ListHostRoleCommandEntity commandEntities = 
hostRoleCommandDAO.findByPKs(taskReports.keySet());
 for (HostRoleCommandEntity commandEntity : commandEntities) {
   CommandReport report = taskReports.get(commandEntity.getTaskId());
-  commandEntity.setStatus(HostRoleStatus.valueOf(report.getStatus()));
+  if (commandEntity.getStatus() != HostRoleStatus.ABORTED) {
+// We don't want to overwrite statuses for ABORTED tasks with
+// statuses that have been received from the agent after aborting task
+commandEntity.setStatus(HostRoleStatus.valueOf(report.getStatus()));
+  }
   commandEntity.setStdOut(report.getStdOut().getBytes());
   commandEntity.setStdError(report.getStdErr().getBytes());
   commandEntity.setStructuredOut(report.getStructuredOut() == null ? null :

http://git-wip-us.apache.org/repos/asf/ambari/blob/7c0bab11/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
index 3bcf8c2..e2fad5f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
@@ -36,6 +36,7 @@ import org.slf4j.LoggerFactory;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -118,28 +119,39 @@ public class ActionManager {
 return db.getAllStages(requestId);
   }
 
+  public HostRoleCommand getTaskById(long taskId) {
+return db.getTask(taskId);
+  }
+
   /**
* Persists command reports into the db
+   * @param reports command reports
+   * @param commands a list of commands that correspond to reports list (it 
should be
+   * a 1 to 1 matching). We use this list to avoid fetching commands from the 
DB
+   * twice
*/
-  public void processTaskResponse(String hostname, ListCommandReport 
reports) {
+  public void processTaskResponse(String hostname, ListCommandReport reports,
+  CollectionHostRoleCommand commands) {
 if (reports == null) {
   return;
 }
 
 ListCommandReport reportsToProcess 

git commit: AMBARI-6828. Postfixes for server-side implementation of Cancel requests (dlysnichenko)

2014-08-12 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 382e7f3df - 9bbb43e57


AMBARI-6828. Postfixes for server-side implementation of Cancel requests 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 9bbb43e57bb6071fabcb23c12ffb222fb33cccdb
Parents: 382e7f3
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Aug 8 15:13:24 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Aug 12 19:13:38 2014 +0300

--
 .../actionmanager/ActionDBAccessorImpl.java |   5 +
 .../server/actionmanager/ActionScheduler.java   |   2 +-
 .../actionmanager/TestActionDBAccessorImpl.java |  33 +-
 .../actionmanager/TestActionScheduler.java  | 193 +--
 .../server/agent/TestHeartbeatHandler.java  | 323 +++
 5 files changed, 464 insertions(+), 92 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9bbb43e5/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 dae9048..5e879cc 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
@@ -346,6 +346,7 @@ public class ActionDBAccessorImpl implements 
ActionDBAccessor {
 long now = System.currentTimeMillis();
 
 ListLong requestsToCheck = new ArrayListLong();
+ListLong abortedCommandUpdates = new ArrayListLong();
 
 ListHostRoleCommandEntity commandEntities = 
hostRoleCommandDAO.findByPKs(taskReports.keySet());
 for (HostRoleCommandEntity commandEntity : commandEntities) {
@@ -354,6 +355,8 @@ public class ActionDBAccessorImpl implements 
ActionDBAccessor {
 // We don't want to overwrite statuses for ABORTED tasks with
 // statuses that have been received from the agent after aborting task
 commandEntity.setStatus(HostRoleStatus.valueOf(report.getStatus()));
+  } else {
+abortedCommandUpdates.add(commandEntity.getTaskId());
   }
   commandEntity.setStdOut(report.getStdOut().getBytes());
   commandEntity.setStdError(report.getStdErr().getBytes());
@@ -375,6 +378,8 @@ public class ActionDBAccessorImpl implements 
ActionDBAccessor {
 }
 
 hostRoleCommandDAO.mergeAll(commandEntities);
+// Invalidate cache because of updates to ABORTED commands
+hostRoleCommandCache.invalidateAll(abortedCommandUpdates);
 
 for (Long requestId : requestsToCheck) {
   endRequestIfCompleted(requestId);

http://git-wip-us.apache.org/repos/asf/ambari/blob/9bbb43e5/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 cab891f..b9a67b7 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
@@ -794,7 +794,7 @@ class ActionScheduler implements Runnable {
* @param hostRoleCommands a list of hostRoleCommands
* @param reason why the request is being cancelled
*/
-  private void cancelHostRoleCommands(CollectionHostRoleCommand 
hostRoleCommands, String reason) {
+  void cancelHostRoleCommands(CollectionHostRoleCommand hostRoleCommands, 
String reason) {
 for (HostRoleCommand hostRoleCommand : hostRoleCommands) {
   if (hostRoleCommand.getStatus() == HostRoleStatus.QUEUED) {
 // Dequeue all tasks that have been already scheduled for sending to 
agent

http://git-wip-us.apache.org/repos/asf/ambari/blob/9bbb43e5/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java
index a94f421..2850897 100644
--- 

git commit: AMBARI-6899. Add unit test to ensure iptables stay off (if they were initially turned off) (dlysnichenko)

2014-08-19 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 0116db8d5 - 7d8927c8e


AMBARI-6899. Add unit test to ensure iptables stay off (if they were initially 
turned off) (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 7d8927c8e3026306ad246a18180e083346c00d76
Parents: 0116db8
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Aug 19 17:18:22 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Aug 19 17:19:13 2014 +0300

--
 .../src/main/python/ambari_agent/HostInfo.py| 104 +-
 .../test/python/ambari_agent/TestHostInfo.py|  60 +++-
 .../python/ambari_agent/TestRegistration.py |   3 +-
 .../src/main/python/ambari_commons/__init__.py  |   3 +
 .../src/main/python/ambari_commons/firewall.py  | 140 +++
 ambari-server/src/main/python/ambari-server.py  | 113 +++
 .../src/test/python/TestAmbariServer.py | 133 --
 7 files changed, 277 insertions(+), 279 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7d8927c8/ambari-agent/src/main/python/ambari_agent/HostInfo.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/HostInfo.py 
b/ambari-agent/src/main/python/ambari_agent/HostInfo.py
index bd0c286..ff91dc4 100644
--- a/ambari-agent/src/main/python/ambari_agent/HostInfo.py
+++ b/ambari-agent/src/main/python/ambari_agent/HostInfo.py
@@ -32,23 +32,14 @@ import hostname
 from PackagesAnalyzer import PackagesAnalyzer
 from HostCheckReportFileHandler import HostCheckReportFileHandler
 from Hardware import Hardware
-from ambari_commons import OSCheck, OSConst
+from ambari_commons import OSCheck, OSConst, Firewall
 import socket
 
 logger = logging.getLogger()
 
-# OS info
-OS_VERSION = OSCheck().get_os_major_version()
-OS_TYPE = OSCheck.get_os_type()
-OS_FAMILY = OSCheck.get_os_family()
-
 # service cmd
 SERVICE_CMD = /sbin/service
 
-# on ubuntu iptables service is called ufw
-if OS_FAMILY == OSConst.DEBIAN_FAMILY:
-  SERVICE_CMD = /usr/sbin/service
-
 
 class HostInfo:
   # List of project names to be used to find alternatives folders etc.
@@ -324,25 +315,8 @@ class HostInfo:
 else:
   return 
 
-  def getFirewallObject(self):
-if OS_TYPE == OSConst.OS_UBUNTU:
-  return UbuntuFirewallChecks()
-elif OS_TYPE == OSConst.OS_FEDORA and int(OS_VERSION) = 18:
-  return Fedora18FirewallChecks()
-elif OS_FAMILY == OSConst.SUSE_FAMILY:
-  return SuseFirewallChecks()
-else:
-  return FirewallChecks()
-
-  def getFirewallObjectTypes(self):
-# To support test code, so tests can loop through the types
-return (FirewallChecks,
-UbuntuFirewallChecks,
-Fedora18FirewallChecks,
-SuseFirewallChecks)
-
   def checkIptables(self):
-return self.getFirewallObject().check_iptables()
+return Firewall().getFirewallObject().check_iptables()
 
Return various details about the host
   componentsMapped: indicates if any components are mapped to this host
@@ -425,80 +399,6 @@ class HostInfo:
   pass
 return False
 
-
-class FirewallChecks(object):
-  def __init__(self):
-self.FIREWALL_SERVICE_NAME = iptables
-self.SERVICE_CMD = SERVICE_CMD
-self.SERVICE_SUBCMD = status
-
-  def get_command(self):
-return %s %s %s % (self.SERVICE_CMD, self.FIREWALL_SERVICE_NAME, 
self.SERVICE_SUBCMD)
-
-  def check_result(self, retcode, out, err):
-  return retcode == 0
-
-  def check_iptables(self):
-retcode, out, err = self.run_os_command(self.get_command())
-return self.check_result(retcode, out, err)
-
-  def get_running_result(self):
-# To support test code.  Expected ouput from run_os_command.
-return (0, , )
-
-  def get_stopped_result(self):
-# To support test code.  Expected output from run_os_command.
-return (3, , )
-
-  def run_os_command(self, cmd):
-if type(cmd) == str:
-  cmd = shlex.split(cmd)
-
-try:
-  process = subprocess.Popen(cmd, stdout=subprocess.PIPE, 
stdin=subprocess.PIPE,
-stderr=subprocess.PIPE)
-  (stdoutdata, stderrdata) = process.communicate()
-  return process.returncode, stdoutdata, stderrdata
-except OSError:
-  return self.get_stopped_result()
-
-
-class UbuntuFirewallChecks(FirewallChecks):
-  def __init__(self):
-super(UbuntuFirewallChecks, self).__init__()
-
-self.FIREWALL_SERVICE_NAME = ufw
-self.SERVICE_CMD = 'service'
-
-  def check_result(self, retcode, out, err):
-# On ubuntu, the status command returns 0 

git commit: AMBARI-6918. After putting RM in MaintMode (and stopping component), service shows stopped (dlysnichenko)

2014-08-19 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 5aaa32c19 - 4644a826b


AMBARI-6918. After putting RM in MaintMode (and stopping component), service 
shows stopped (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 4644a826ba2b9a13a0815c356faaa9529e1922bc
Parents: 5aaa32c
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Aug 19 17:47:16 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Aug 19 22:03:28 2014 +0300

--
 .../internal/ServiceResourceProvider.java   |  52 +
 .../internal/ServiceResourceProviderTest.java   | 113 +++
 2 files changed, 146 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4644a826/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
index c77b8d6..f8a362d 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java
@@ -992,34 +992,48 @@ public class ServiceResourceProvider extends 
AbstractControllerResourceProvider
 
   if (componentInfo != null) {
 State state = getHostComponentState(hostComponentResponse);
+// Components in MM should not affect service status,
+// so we tend to ignore them
+boolean isInMaintenance = ! MaintenanceState.OFF.toString().
+equals(hostComponentResponse.getMaintenanceState());
 
-if (state.equals(State.DISABLED)) {
+if (state.equals(State.DISABLED) || isInMaintenance) {
   hasDisabled = true;
-} else {
-  if (componentInfo.isMaster()) {
+}
+
+if (componentInfo.isMaster()) {
+  if (state.equals(State.STARTED) || ! isInMaintenance) {
+// We rely on master's state to determine service state
 hasMaster = true;
-if(!state.equals(State.STARTED) 
-( masterState == null || state.ordinal()  
masterState.ordinal())) {
-  masterState = state;
-}
-  } else if (componentInfo.isClient()) {
-hasClient = true;
-if (!state.equals(State.INSTALLED) 
-(clientState == null || state.ordinal()  
clientState.ordinal())) {
-  clientState = state;
-}
-  } else {
-hasOther  = true;
-if (otherState == null || state.ordinal()  
otherState.ordinal()) {
-  otherState = state;
-}
+  }
+
+  if (! state.equals(State.STARTED) 
+  ! isInMaintenance   // Ignore status of MM component
+  ( masterState == null || state.ordinal()  
masterState.ordinal())) {
+masterState = state;
+  }
+} else if (componentInfo.isClient()) {
+  hasClient = true;
+  if (!state.equals(State.INSTALLED) 
+  (clientState == null || state.ordinal()  
clientState.ordinal())) {
+clientState = state;
+  }
+} else {
+  if (state.equals(State.STARTED) || ! isInMaintenance) {
+// We rely on slaves's state to determine service state
+hasOther = true;
+  }
+  if (! state.equals(State.STARTED) 
+  ! isInMaintenance  // Ignore status of MM component
+  ( otherState == null || state.ordinal()  
otherState.ordinal())) {
+otherState = state;
   }
 }
   }
 }
 
 return hasMaster   ? masterState == null ? State.STARTED : 
masterState :
-   hasOther? otherState :
+   hasOther? otherState == null ? State.STARTED : 
otherState :
hasClient   ? clientState == null ? 

git commit: AMBARI-6934. Broken ambari-server setup on sles11sp1 (dlysnichenko)

2014-08-20 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 82fdc6957 - 53ec9ed43


AMBARI-6934. Broken ambari-server setup on sles11sp1 (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 53ec9ed432deb53aed64db8120db283a2235ad8c
Parents: 82fdc69
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Aug 20 17:16:57 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Aug 20 17:18:02 2014 +0300

--
 .../src/main/python/ambari_commons/firewall.py  | 15 +++--
 .../src/test/python/TestAmbariServer.py | 35 ++--
 2 files changed, 28 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/53ec9ed4/ambari-common/src/main/python/ambari_commons/firewall.py
--
diff --git a/ambari-common/src/main/python/ambari_commons/firewall.py 
b/ambari-common/src/main/python/ambari_commons/firewall.py
index 1cf69ee..b73cc0c 100644
--- a/ambari-common/src/main/python/ambari_commons/firewall.py
+++ b/ambari-common/src/main/python/ambari_commons/firewall.py
@@ -101,19 +101,12 @@ class UbuntuFirewallChecks(FirewallChecks):
 result = True
 return result
 
-  def get_running_result(self):
-# To support test code.  Expected ouput from run_os_command.
-return (0, ufw start/running, )
-
-  def get_stopped_result(self):
-# To support test code.  Expected output from run_os_command.
-return (0, ufw stop/waiting, )
-
-
 class Fedora18FirewallChecks(FirewallChecks):
+  def __init__(self):
+super(Fedora18FirewallChecks, self).__init__()
 
   def get_command(self):
-return systemctl is-active iptables
+return systemctl is-active %s % (self.FIREWALL_SERVICE_NAME)
 
   def check_result(self, retcode, out, err):
 result = False
@@ -124,8 +117,8 @@ class Fedora18FirewallChecks(FirewallChecks):
 
 class SuseFirewallChecks(FirewallChecks):
   def __init__(self):
+super(SuseFirewallChecks, self).__init__()
 self.FIREWALL_SERVICE_NAME = SuSEfirewall2
-self.SERVICE_SUBCMD = status
 
   def get_command(self):
 return %s %s % (self.FIREWALL_SERVICE_NAME, self.SERVICE_SUBCMD)

http://git-wip-us.apache.org/repos/asf/ambari/blob/53ec9ed4/ambari-server/src/test/python/TestAmbariServer.py
--
diff --git a/ambari-server/src/test/python/TestAmbariServer.py 
b/ambari-server/src/test/python/TestAmbariServer.py
index 46078ac..ad80b1e 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -1005,54 +1005,67 @@ class TestAmbariServer(TestCase):
 ambari_server.store_password_file(password, passfile)
 self.assertTrue(set_file_permissions_mock.called)
 
-
-  @patch.object(FirewallChecks, run_os_command)
+  @patch(subprocess.Popen)
   @patch.object(OSCheck, get_os_family)
   @patch.object(OSCheck, get_os_type)
   @patch.object(OSCheck, get_os_major_version)
-  def test_check_iptables_is_running(self, get_os_major_version_mock, 
get_os_type_mock, get_os_family_mock, run_os_command_mock):
+  def test_check_iptables_is_running(self, get_os_major_version_mock, 
get_os_type_mock, get_os_family_mock, popen_mock):
 
 get_os_major_version_mock.return_value = 18
 get_os_type_mock.return_value = OSConst.OS_FEDORA
 get_os_family_mock.return_value = OSConst.REDHAT_FAMILY
 
 firewall_obj = Firewall().getFirewallObject()
-run_os_command_mock.return_value = 0, active, 
+p = MagicMock()
+p.communicate.return_value = (active, err)
+p.returncode = 0
+popen_mock.return_value = p
 self.assertEqual(Fedora18FirewallChecks, firewall_obj.__class__.__name__)
 self.assertTrue(firewall_obj.check_iptables())
-run_os_command_mock.return_value = 3, , 
+p.communicate.return_value = (, err)
+p.returncode = 3
 self.assertFalse(firewall_obj.check_iptables())
+self.assertEqual(err, firewall_obj.stderrdata)
 
 
 get_os_type_mock.return_value = OSConst.OS_UBUNTU
 get_os_family_mock.return_value = OSConst.DEBIAN_FAMILY
 
 firewall_obj = Firewall().getFirewallObject()
-run_os_command_mock.return_value = 0, Status: active, 
+p.communicate.return_value = (Status: active, err)
+p.returncode = 0
 self.assertEqual(UbuntuFirewallChecks, firewall_obj.__class__.__name__)
 self.assertTrue(firewall_obj.check_iptables())
-run_os_command_mock.return_value = 0, Status: inactive, 
+p.communicate.return_value = (Status: inactive, err)
+p.returncode = 0
 

git commit: AMBARI-6945. mvn clean does not remove *.pyc files (dlysnichenko)

2014-08-20 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 490903a12 - 3eddc800d


AMBARI-6945. mvn clean does not remove *.pyc files (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 3eddc800d4ab63be4b7edd945eb43ad8e11ac22d
Parents: 490903a
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Aug 20 18:40:17 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Aug 20 18:58:32 2014 +0300

--
 pom.xml | 20 
 1 file changed, 20 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/3eddc800/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 356090e..bf62fd2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -73,6 +73,11 @@
   groupIdorg.vafer/groupId
   artifactIdjdeb/artifactId
 /plugin
+plugin
+  groupIdorg.apache.maven.plugins/groupId
+  artifactIdmaven-clean-plugin/artifactId
+  version2.5/version
+/plugin
   /plugins
 /pluginManagement
 plugins
@@ -266,6 +271,21 @@
   
controlDir${basedir}/ambari-project/src/main/package/deb/control/controlDir
 /configuration
   /plugin
+  plugin
+groupIdorg.apache.maven.plugins/groupId
+artifactIdmaven-clean-plugin/artifactId
+configuration
+  filesets
+fileset
+  directory${basedir}/directory
+  followSymlinksfalse/followSymlinks
+   includes
+include**/*.pyc/include
+  /includes
+ /fileset
+  /filesets
+/configuration
+  /plugin
 /plugins
   /build
   profiles



git commit: AMBARI-6958. If postgres user cannot login, the upgrade fails (dlysnichenko)

2014-08-21 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 3a05d2ca1 - 9434e18be


AMBARI-6958. If postgres user cannot login, the upgrade fails (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 9434e18beea56f82a1c2c6d7220b714923e7c2c4
Parents: 3a05d2c
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Aug 20 23:26:23 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Aug 21 13:51:27 2014 +0300

--
 ambari-server/src/main/python/ambari-server.py  | 13 --
 .../src/test/python/TestAmbariServer.py | 43 
 2 files changed, 52 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9434e18b/ambari-server/src/main/python/ambari-server.py
--
diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index bb9870b..23c8444 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -2632,7 +2632,14 @@ def change_objects_owner(args):
 
   command = CHANGE_OWNER_COMMAND[:]
   command[-1] = command[-1].format(database_name, 'ambari', new_owner)
-  return run_os_command(command)
+  retcode, stdout, stderr = run_os_command(command)
+  if not retcode == 0:
+if VERBOSE:
+  if stdout:
+print_error_msg(stdout.strip())
+  if stderr:
+print_error_msg(stderr.strip())
+raise FatalException(20, 'Unable to change owner of database objects')
 
 
 def compare_versions(version1, version2):
@@ -2737,9 +2744,7 @@ def upgrade(args):
   parse_properties_file(args)
   #TODO check database version
   if args.persistence_type == 'local':
-retcode, stdout, stderr = change_objects_owner(args)
-if not retcode == 0:
-  raise FatalException(20, 'Unable to change owner of database objects')
+change_objects_owner(args)
 
   retcode = run_schema_upgrade()
   if not retcode == 0:

http://git-wip-us.apache.org/repos/asf/ambari/blob/9434e18b/ambari-server/src/test/python/TestAmbariServer.py
--
diff --git a/ambari-server/src/test/python/TestAmbariServer.py 
b/ambari-server/src/test/python/TestAmbariServer.py
index ad80b1e..cd81a7e 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -5107,3 +5107,46 @@ 
MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
 
 self.assertTrue(perform_housekeeping_mock.called)
 
+  @patch.object(ambari_server, run_os_command)
+  @patch.object(ambari_server, print_error_msg)
+  def test_change_objects_owner_both(self,
+ print_error_msg_mock,
+ run_os_command_mock):
+args = MagicMock()
+stdout =  stdout 
+stderr =  stderr 
+run_os_command_mock.return_value = 1, stdout, stderr
+
+ambari_server.VERBOSE = True
+self.assertRaises(FatalException, ambari_server.change_objects_owner, args)
+print_error_msg_mock.assert_any_call(stderr)
+print_error_msg_mock.assert_any_call(stdout)
+
+  @patch.object(ambari_server, run_os_command)
+  @patch.object(ambari_server, print_error_msg)
+  def test_change_objects_owner_only_stdout(self,
+print_error_msg_mock,
+run_os_command_mock):
+args = MagicMock()
+stdout =  stdout 
+stderr = 
+run_os_command_mock.return_value = 1, stdout, stderr
+
+ambari_server.VERBOSE = True
+self.assertRaises(FatalException, ambari_server.change_objects_owner, args)
+print_error_msg_mock.assert_called_once_with(stdout)
+
+  @patch.object(ambari_server, run_os_command)
+  @patch.object(ambari_server, print_error_msg)
+  def test_change_objects_owner_only_stderr(self,
+print_error_msg_mock,
+run_os_command_mock):
+args = MagicMock()
+stdout = 
+stderr =  stderr 
+run_os_command_mock.return_value = 1, stdout, stderr
+
+ambari_server.VERBOSE = True
+self.assertRaises(FatalException, ambari_server.change_objects_owner, args)
+print_error_msg_mock.assert_called_once_with(stderr)
+



git commit: AMBARI-6978. Uncatched exception at ambari agent - it may die on connection error (dlysnichenko)

2014-08-21 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 0822a54b2 - 8f02714e5


AMBARI-6978. Uncatched exception at ambari agent - it may die on connection 
error (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 8f02714e5bff2c943caa309f020d7060e509735e
Parents: 0822a54
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Aug 21 16:04:55 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Aug 21 20:14:31 2014 +0300

--
 .../src/main/python/ambari_agent/Controller.py  | 55 +++---
 .../test/python/ambari_agent/TestController.py  | 76 
 2 files changed, 90 insertions(+), 41 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8f02714e/ambari-agent/src/main/python/ambari_agent/Controller.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/Controller.py 
b/ambari-agent/src/main/python/ambari_agent/Controller.py
index 87af939..7859a2d 100644
--- a/ambari-agent/src/main/python/ambari_agent/Controller.py
+++ b/ambari-agent/src/main/python/ambari_agent/Controller.py
@@ -78,17 +78,20 @@ class Controller(threading.Thread):
   def __del__(self):
 logger.info(Server connection disconnected.)
 pass
-  
+
   def registerWithServer(self):
+
+:return: returning from current method without setting self.isRegistered
+to True will lead to agent termination.
+
 LiveStatus.SERVICES = []
 LiveStatus.CLIENT_COMPONENTS = []
 LiveStatus.COMPONENTS = []
-id = -1
 ret = {}
 
 while not self.isRegistered:
   try:
-data = json.dumps(self.register.build(id))
+data = json.dumps(self.register.build())
 prettyData = pprint.pformat(data)
 
 try:
@@ -111,8 +114,7 @@ class Controller(threading.Thread):
   # log - message, which will be printed to agents log
   if 'log' in ret.keys():
 log = ret['log']
-
-  logger.error(log)
+logger.error(log)
   self.isRegistered = False
   self.repeatRegistration = False
   return ret
@@ -122,23 +124,22 @@ class Controller(threading.Thread):
 self.responseId = int(ret['responseId'])
 self.isRegistered = True
 if 'statusCommands' in ret.keys():
-  logger.info(Got status commands on registration  + 
pprint.pformat(ret['statusCommands']) )
+  logger.info(Got status commands on registration  + 
pprint.pformat(ret['statusCommands']))
   self.addToStatusQueue(ret['statusCommands'])
   pass
 else:
   self.hasMappedComponents = False
 pass
   except ssl.SSLError:
-self.repeatRegistration=False
+self.repeatRegistration = False
 self.isRegistered = False
 return
   except Exception:
 # try a reconnect only after a certain amount of random time
 delay = randint(0, self.range)
-logger.error(Unable to connect to:  + self.registerUrl, exc_info = 
True)
+logger.error(Unable to connect to:  + self.registerUrl, 
exc_info=True)
  Sleeping for {0} seconds and then retrying again .format(delay)
 time.sleep(delay)
-pass
   pass
 return ret
 
@@ -147,7 +148,7 @@ class Controller(threading.Thread):
 if commands:
   self.actionQueue.cancel(commands)
 pass
-  
+
   def addToQueue(self, commands):
 Add to the queue for running the commands 
  Put the required actions into the Queue 
@@ -178,11 +179,8 @@ class Controller(threading.Thread):
 self.DEBUG_SUCCESSFULL_HEARTBEATS = 0
 retry = False
 certVerifFailed = False
-
 hb_interval = self.config.get('heartbeat', 'state_interval')
 
-#TODO make sure the response id is monotonically increasing
-id = 0
 while not self.DEBUG_STOP_HEARTBEATING:
   try:
 if not retry:
@@ -212,7 +210,7 @@ class Controller(threading.Thread):
   logger.info('Heartbeat response received (id = %s)', serverId)
 
 if 'hasMappedComponents' in response.keys():
-  self.hasMappedComponents = response['hasMappedComponents'] != False
+  self.hasMappedComponents = response['hasMappedComponents'] is not 
False
 
 if 'registrationCommand' in response.keys():
   # check if the registration command is None. If none skip
@@ -226,7 +224,7 @@ class Controller(threading.Thread):
   logger.error(Error in responseId sequence - restarting)
   self.restartAgent()
 else:
-  self.responseId=serverId
+

git commit: AMBARI-6955. Allow Customers To Define The Sqoop User (dlysnichenko)

2014-08-21 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 0ea954d7b - 65417f715


AMBARI-6955. Allow Customers To Define The Sqoop User (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 65417f715c39f36a5d24d7bcf6360af0bcc94fb0
Parents: 0ea954d
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Aug 21 20:42:48 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Aug 21 20:44:12 2014 +0300

--
 .../HDP/1.3.2/hooks/before-INSTALL/scripts/params.py  |  4 +++-
 .../before-INSTALL/scripts/shared_initialization.py   |  7 +++
 .../1.3.2/services/SQOOP/configuration/sqoop-env.xml  |  5 +
 .../1.3.2/services/SQOOP/package/scripts/params.py|  2 +-
 .../HDP/2.0.6/hooks/before-INSTALL/scripts/params.py  |  2 ++
 .../before-INSTALL/scripts/shared_initialization.py   |  9 -
 .../2.0.6/services/SQOOP/configuration/sqoop-env.xml  |  6 +-
 .../2.0.6/services/SQOOP/package/scripts/params.py|  2 +-
 .../HDP/2.0.6/services/SQOOP/package/scripts/sqoop.py |  2 +-
 .../stacks/1.3.2/configs/default.hbasedecom.json  |  3 ++-
 .../src/test/python/stacks/1.3.2/configs/default.json |  3 ++-
 .../stacks/1.3.2/configs/default.non_gmetad_host.json |  3 ++-
 .../src/test/python/stacks/1.3.2/configs/secured.json |  3 ++-
 .../1.3.2/hooks/before-INSTALL/test_before_install.py |  5 +
 .../src/test/python/stacks/2.0.6/configs/default.json |  3 ++-
 .../stacks/2.0.6/configs/default.non_gmetad_host.json |  3 ++-
 .../test/python/stacks/2.0.6/configs/ha_default.json  |  5 +++--
 .../test/python/stacks/2.0.6/configs/ha_secured.json  |  5 +++--
 .../src/test/python/stacks/2.0.6/configs/secured.json |  3 ++-
 .../2.0.6/hooks/before-INSTALL/test_before_install.py |  5 +
 .../src/test/python/stacks/2.1/configs/default.json   |  3 ++-
 .../src/test/python/stacks/2.1/configs/secured.json   |  3 ++-
 ambari-web/app/data/HDP2/site_properties.js   | 14 ++
 ambari-web/app/data/site_properties.js| 13 +
 24 files changed, 94 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/65417f71/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/params.py
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/params.py
index 723cd3d..ce8f34b 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/params.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/params.py
@@ -80,6 +80,7 @@ hdfs_user = 
config['configurations']['hadoop-env']['hdfs_user']
 zk_user = config['configurations']['zookeeper-env']['zk_user']
 gmetad_user = config['configurations']['ganglia-env'][gmetad_user]
 gmond_user = config['configurations']['ganglia-env'][gmond_user]
+sqoop_user = config['configurations']['sqoop-env']['sqoop_user']
 
 user_group = config['configurations']['hadoop-env']['user_group']
 proxyuser_group =  config['configurations']['hadoop-env']['proxyuser_group']
@@ -103,6 +104,7 @@ namenode_host = default(/clusterHostInfo/namenode_host, 
[])
 zk_hosts = default(/clusterHostInfo/zookeeper_hosts, [])
 ganglia_server_hosts = default(/clusterHostInfo/ganglia_server_host, [])
 
+has_sqoop_client = 'sqoop-env' in config['configurations']
 has_resourcemanager = not len(rm_host) == 0
 has_namenode = not len(namenode_host) == 0
 has_jt = not len(jtnode_host) == 0
@@ -130,4 +132,4 @@ ignore_groupsusers_create = 
default(/configurations/hadoop-env/ignore_groupsuse
 
 #repo params
 repo_info = config['hostLevelParams']['repo_info']
-service_repo_info = default(/hostLevelParams/service_repo_info,None)
\ No newline at end of file
+service_repo_info = default(/hostLevelParams/service_repo_info,None)

http://git-wip-us.apache.org/repos/asf/ambari/blob/65417f71/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
index 2e8c8cd..f556335 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
+++ 

[2/2] git commit: AMBARI-6061. OutOfMemoryError during host checks on 2k nodes cluster (dlysnichenko)

2014-08-26 Thread dmitriusan
AMBARI-6061. OutOfMemoryError during host checks on 2k nodes cluster 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 9faeaf5a525bfee0932c1a654b28651c0b1705dd
Parents: db83ea2
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Aug 26 15:02:41 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Aug 26 17:24:48 2014 +0300

--
 .../server/actionmanager/ActionScheduler.java   |  33 +
 .../ambari/server/actionmanager/Stage.java  |  32 -
 .../server/actionmanager/StageFactory.java  |   4 +-
 .../ambari/server/agent/ExecutionCommand.java   |   2 +-
 .../controller/AmbariActionExecutionHelper.java |   9 +-
 .../AmbariCustomCommandExecutionHelper.java |  34 ++---
 .../AmbariManagementControllerImpl.java | 128 ++-
 .../ambari/server/orm/entities/StageEntity.java |  28 
 .../ambari/server/stageplanner/RoleGraph.java   |   3 +-
 .../server/upgrade/UpgradeCatalog170.java   |   7 +-
 .../apache/ambari/server/utils/StageUtils.java  |  57 +
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |   2 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |   2 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql|   2 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql |   2 +-
 .../ExecutionCommandWrapperTest.java|   2 +-
 .../actionmanager/TestActionDBAccessorImpl.java |  20 +--
 .../server/actionmanager/TestActionManager.java |  31 +++--
 .../actionmanager/TestActionScheduler.java  |  33 +++--
 .../ambari/server/actionmanager/TestStage.java  |   4 +-
 .../server/agent/TestHeartbeatHandler.java  |  15 ++-
 .../AmbariManagementControllerTest.java |  84 
 .../server/stageplanner/TestStagePlanner.java   |   6 +-
 .../server/upgrade/UpgradeCatalog170Test.java   |  30 +
 .../ambari/server/utils/TestStageUtils.java |  13 +-
 .../app/controllers/wizard/step3_controller.js  |   1 -
 26 files changed, 381 insertions(+), 203 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9faeaf5a/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 b9a67b7..0385686 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
@@ -121,6 +121,8 @@ class ActionScheduler implements Runnable {
   private boolean activeAwakeRequest = false;
   //Cache for clusterHostinfo, key - stageId-requestId
   private CacheString, MapString, SetString clusterHostInfoCache;
+  private CacheString, MapString, String commandParamsStageCache;
+  private CacheString, MapString, String hostParamsStageCache;
 
   public ActionScheduler(long sleepTimeMilliSec, long actionTimeoutMilliSec,
   ActionDBAccessor db, ActionQueue actionQueue, Clusters fsmObject,
@@ -138,6 +140,12 @@ class ActionScheduler implements Runnable {
 this.clusterHostInfoCache = CacheBuilder.newBuilder().
 expireAfterAccess(5, TimeUnit.MINUTES).
 build();
+this.commandParamsStageCache = CacheBuilder.newBuilder().
+  expireAfterAccess(5, TimeUnit.MINUTES).
+  build();
+this.hostParamsStageCache = CacheBuilder.newBuilder().
+  expireAfterAccess(5, TimeUnit.MINUTES).
+  build();
 this.configuration = configuration;
   }
 
@@ -748,6 +756,31 @@ class ActionScheduler implements Runnable {
 }
 
 cmd.setClusterHostInfo(clusterHostInfo);
+ 
+//Try to get commandParams from cache and merge them with command-level 
parameters
+MapString, String commandParams = 
commandParamsStageCache.getIfPresent(stagePk);
+
+if (commandParams == null){
+  Type type = new TypeTokenMapString, String() {}.getType();
+  commandParams = StageUtils.getGson().fromJson(s.getCommandParamsStage(), 
type);
+  commandParamsStageCache.put(stagePk, commandParams);
+}
+MapString, String commandParamsCmd = cmd.getCommandParams();
+commandParamsCmd.putAll(commandParams);
+cmd.setCommandParams(commandParamsCmd);
+
+
+//Try to get hostParams from cache and merge them with command-level 
parameters
+MapString, String hostParams = 
hostParamsStageCache.getIfPresent(stagePk);
+if (hostParams == null) {
+  Type type = new TypeTokenMapString, 

[1/2] AMBARI-6061. OutOfMemoryError during host checks on 2k nodes cluster (dlysnichenko)

2014-08-26 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk db83ea24c - 9faeaf5a5


http://git-wip-us.apache.org/repos/asf/ambari/blob/9faeaf5a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
index 13cb231..1cfba46 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog170Test.java
@@ -134,6 +134,8 @@ public class UpgradeCatalog170Test {
 CaptureDBAccessor.DBColumnInfo clusterConfigAttributesColumnCapture = 
new CaptureDBAccessor.DBColumnInfo();
 CaptureDBAccessor.DBColumnInfo maskColumnCapture = new 
CaptureDBAccessor.DBColumnInfo();
 CaptureDBAccessor.DBColumnInfo maskedColumnCapture = new 
CaptureDBAccessor.DBColumnInfo();
+CaptureDBAccessor.DBColumnInfo stageCommandParamsColumnCapture = new 
CaptureDBAccessor.DBColumnInfo();
+CaptureDBAccessor.DBColumnInfo stageHostParamsColumnCapture = new 
CaptureDBAccessor.DBColumnInfo();
 CaptureListDBAccessor.DBColumnInfo alertDefinitionColumnCapture = new 
CaptureListDBAccessor.DBColumnInfo();
 CaptureListDBAccessor.DBColumnInfo alertHistoryColumnCapture = new 
CaptureListDBAccessor.DBColumnInfo();
 CaptureListDBAccessor.DBColumnInfo alertCurrentColumnCapture = new 
CaptureListDBAccessor.DBColumnInfo();
@@ -148,6 +150,7 @@ public class UpgradeCatalog170Test {
 setViewExpectations(dbAccessor, maskColumnCapture);
 setViewParameterExpectations(dbAccessor, maskedColumnCapture);
 setClusterConfigExpectations(dbAccessor, 
clusterConfigAttributesColumnCapture);
+setStageExpectations(dbAccessor, stageCommandParamsColumnCapture, 
stageHostParamsColumnCapture);
 
 dbAccessor.createTable(eq(alert_definition),
 capture(alertDefinitionColumnCapture), eq(definition_id));
@@ -200,6 +203,7 @@ public class UpgradeCatalog170Test {
 assertClusterConfigColumns(clusterConfigAttributesColumnCapture);
 assertViewColumns(maskColumnCapture);
 assertViewParameterColumns(maskedColumnCapture);
+assertStageColumns(stageCommandParamsColumnCapture, 
stageHostParamsColumnCapture);
 
 assertEquals(12, alertDefinitionColumnCapture.getValue().size());
 assertEquals(11, alertHistoryColumnCapture.getValue().size());
@@ -424,6 +428,17 @@ public class UpgradeCatalog170Test {
 dbAccessor.addColumn(eq(clusterconfig),
 capture(clusterConfigAttributesColumnCapture));
   }
+ 
+  private void setStageExpectations(DBAccessor dbAccessor,
+CaptureDBAccessor.DBColumnInfo 
stageCommandParamsColumnCapture,
+CaptureDBAccessor.DBColumnInfo 
stageHostParamsColumnCapture)
+throws SQLException {
+dbAccessor.addColumn(eq(stage),
+  capture(stageCommandParamsColumnCapture));
+
+dbAccessor.addColumn(eq(stage),
+  capture(stageHostParamsColumnCapture));
+  }
 
   @Test
   public void testGetSourceVersion() {
@@ -465,4 +480,19 @@ public class UpgradeCatalog170Test {
 assertNull(column.getDefaultValue());
 assertTrue(column.isNullable());
   }
+
+  private void assertStageColumns(CaptureDBAccessor.DBColumnInfo 
stageCommandParamsColumnCapture,
+  CaptureDBAccessor.DBColumnInfo 
stageHostParamsColumnCapture) {
+DBAccessor.DBColumnInfo column = 
stageCommandParamsColumnCapture.getValue();
+assertEquals(command_params, column.getName());
+assertEquals(byte[].class, column.getType());
+assertEquals(null, column.getDefaultValue());
+assertTrue(column.isNullable());
+
+column = stageHostParamsColumnCapture.getValue();
+assertEquals(host_params, column.getName());
+assertEquals(byte[].class, column.getType());
+assertEquals(null, column.getDefaultValue());
+assertTrue(column.isNullable());
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/9faeaf5a/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java
index 6e587f1..988c67b 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/utils/TestStageUtils.java
@@ -20,6 +20,8 @@ package org.apache.ambari.server.utils;
 import static org.easymock.EasyMock.expect;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+import static org.powermock.api.easymock.PowerMock.mockStaticPartial;
+import 

git commit: AMBARI-6010. No such service ambari-agent when trying to use service cmd on agent on SUSE (dlysnichenko)

2014-08-26 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk e984e9b84 - fb9d884be


AMBARI-6010. No such service ambari-agent when trying to use service cmd on 
agent on SUSE (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: fb9d884be4ea4257831d591cd0e4f19c87321e69
Parents: e984e9b
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Aug 26 21:26:28 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Aug 26 21:26:28 2014 +0300

--
 ambari-agent/pom.xml | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fb9d884b/ambari-agent/pom.xml
--
diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index ebf30fa..a487aa7 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -49,6 +49,7 @@
 ambari.server.module../ambari-server/ambari.server.module
 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
   /properties
   build
 plugins
@@ -349,7 +350,7 @@
   groupnameroot/groupname
 /mapping
 mapping
-  directory/etc/rc.d/init.d/directory
+  directory${init.d.dir}/directory
   filemode755/filemode
   usernameroot/username
   groupnameroot/groupname
@@ -666,4 +667,12 @@
   /extension
 /extensions
   /build
+  profiles
+profile
+  idsuse11/id
+  properties
+init.d.dir/etc/init.d/init.d.dir
+  /properties
+/profile
+  /profiles
 /project



git commit: AMBARI-7062. Client Config Download: log4j properties filenames should be the same as on an installed cluster host. (dlysnichenko)

2014-08-28 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 86d408397 - d1bdc818e


AMBARI-7062. Client Config Download: log4j properties filenames should be the 
same as on an installed cluster host. (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: d1bdc818e5d4c481d43955bcd7f4ece253b15eb5
Parents: 86d4083
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Aug 28 20:34:34 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Aug 28 20:34:34 2014 +0300

--
 .../python/resource_management/libraries/script/script.py |  9 ++---
 .../stacks/HDP/1.3.2/services/HBASE/metainfo.xml  |  2 +-
 .../resources/stacks/HDP/1.3.2/services/HDFS/metainfo.xml |  4 ++--
 .../stacks/HDP/1.3.2/services/MAPREDUCE/metainfo.xml  |  9 ++---
 .../resources/stacks/HDP/1.3.2/services/PIG/metainfo.xml  |  2 +-
 .../stacks/HDP/1.3.2/services/ZOOKEEPER/metainfo.xml  |  2 +-
 .../stacks/HDP/2.0.6/services/HBASE/metainfo.xml  |  2 +-
 .../resources/stacks/HDP/2.0.6/services/HDFS/metainfo.xml |  4 ++--
 .../resources/stacks/HDP/2.0.6/services/PIG/metainfo.xml  | 10 +-
 .../resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml |  4 ++--
 .../stacks/HDP/2.0.6/services/ZOOKEEPER/metainfo.xml  |  2 +-
 .../resources/stacks/HDP/2.1/services/FALCON/metainfo.xml | 10 ++
 .../src/test/python/stacks/2.0.6/HDFS/test_hdfs_client.py |  4 
 .../src/test/python/stacks/2.0.6/configs/default.json |  2 +-
 14 files changed, 35 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-common/src/main/python/resource_management/libraries/script/script.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/script/script.py 
b/ambari-common/src/main/python/resource_management/libraries/script/script.py
index 7b7d931..80bfeab 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/script/script.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/script/script.py
@@ -258,10 +258,13 @@ class Script(object):
   
configuration_attributes=params.config['configuration_attributes'][dict],
 )
 for file_dict in env_configs_list:
-  for filename,dict in file_dict.iteritems():
+  for filename,dicts in file_dict.iteritems():
+content = ''
+for dict in dicts.split(','):
+  if dict.strip() in params.config['configurations']:
+content += params.config['configurations'][dict.strip()]['content']
 File(os.path.join(conf_tmp_dir, filename),
- 
content=InlineTemplate(params.config['configurations'][dict]['content'])
-)
+ content=InlineTemplate(content))
 with closing(tarfile.open(output_filename, w:gz)) as tar:
   tar.add(conf_tmp_dir, arcname=os.path.basename(.))
   tar.close()

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
index f209475..090bad8 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
@@ -108,7 +108,7 @@
 /configFile
 configFile
   typeenv/type
-  fileNamehbase-log4j.properties/fileName
+  fileNamelog4j.properties/fileName
   dictionaryNamehbase-log4j/dictionaryName
 /configFile
   /configFiles

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1bdc818/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/metainfo.xml
index 7112c31..2aa0590 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/metainfo.xml
@@ -99,8 +99,8 @@
 /configFile  
 configFile
   typeenv/type
-  fileNamehdfs-log4j.properties/fileName
-

ambari git commit: AMBARI-8434. Distribute Repositories/Install Components - server part (dlysnichenko)

2014-12-03 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk ff1459b88 - 71cf447e6


AMBARI-8434. Distribute Repositories/Install Components - server part 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 71cf447e6aafb1aa1cf3cd52e5e43e23bb378080
Parents: ff1459b
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Nov 19 18:02:50 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Dec 3 15:53:36 2014 +0200

--
 .../services/ClusterStackVersionService.java|  16 ++
 .../ambari/server/api/services/HostService.java |   6 +-
 .../api/services/HostStackVersionService.java   |  36 ++-
 .../server/api/services/RequestService.java |   4 +-
 .../controller/AmbariManagementController.java  |  13 +
 .../AmbariManagementControllerImpl.java |  58 ++--
 .../AbstractControllerResourceProvider.java |   4 +
 .../ClusterStackVersionResourceProvider.java| 226 +++-
 .../internal/DefaultProviderModule.java |   4 +-
 .../HostStackVersionResourceProvider.java   | 263 ++-
 .../spi/NoSuchParentResourceException.java  |   9 +
 .../custom_actions/scripts/install_packages.py  |  21 +-
 .../services/HostStackVersionServiceTest.java   |   8 +-
 .../AmbariManagementControllerTest.java |  37 ++-
 ...ClusterStackVersionResourceProviderTest.java | 243 +
 .../HostStackVersionResourceProviderTest.java   | 217 +++
 .../custom_actions/TestInstallPackages.py   |  52 ++--
 .../configs/install_packages_config.json|   8 +-
 18 files changed, 1140 insertions(+), 85 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/71cf447e/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterStackVersionService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterStackVersionService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterStackVersionService.java
index 6a706ff..f9ae235 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterStackVersionService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterStackVersionService.java
@@ -21,6 +21,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import javax.ws.rs.GET;
+import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
@@ -98,6 +99,21 @@ public class ClusterStackVersionService extends BaseService {
   }
 
   /**
+   * Handles: POST /{clustername}/stack_versions requests
+   * Distribute repositories/install packages.
+   *
+   * @param bodyhttp body
+   * @param headers http headers
+   * @param ui  uri info
+   * @return information regarding the created services
+   */
+  @POST
+  @Produces(text/plain)
+  public Response createRequests(String body, @Context HttpHeaders headers, 
@Context UriInfo ui) {
+return handleRequest(headers, body, ui, Request.Type.POST, 
createResource(null));
+  }
+
+  /**
* Create a cluster stack version resource instance.
*
* @param stackVersionId cluster stack version id

http://git-wip-us.apache.org/repos/asf/ambari/blob/71cf447e/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostService.java
index c4ad169..aaf3007 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/HostService.java
@@ -249,7 +249,7 @@ public class HostService extends BaseService {
   public HostStackVersionService getHostStackVersionService(@Context 
javax.ws.rs.core.Request request,
   @PathParam(hostName) String hostName) {
 
-return new HostStackVersionService(hostName);
+return new HostStackVersionService(hostName, m_clusterName);
   }
 
   /**
@@ -264,11 +264,9 @@ public class HostService extends BaseService {
* @return a host resource instance
*/
   ResourceInstance createHostResource(String clusterName, String hostName, 
UriInfo ui) {
-boolean isAttached = ui.getRequestUri().toString().contains(/clusters/);
-
 MapResource.Type,String mapIds = new HashMapResource.Type, String();
 

ambari git commit: AMBARI-8586. Add missed custom actions list to component resource. (dlysnichenko)

2014-12-08 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk fd68afd31 - dcbdcdfa7


AMBARI-8586. Add missed custom actions list to component resource. 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: dcbdcdfa71492916d1f8e9d96077c17688932694
Parents: fd68afd
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Dec 8 19:05:10 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Dec 8 19:05:57 2014 +0200

--
 .../stacks/HDP/1.3.2/services/HBASE/metainfo.xml  | 10 --
 .../services/HBASE/package/scripts/hbase_regionserver.py  |  4 
 2 files changed, 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/dcbdcdfa/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
index 090bad8..853770f 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/metainfo.xml
@@ -74,16 +74,6 @@
 scriptscripts/hbase_regionserver.py/script
 scriptTypePYTHON/scriptType
   /commandScript
-  customCommands
-customCommand
-  nameDECOMMISSION/name
-  commandScript
-scriptscripts/hbase_regionserver.py/script
-scriptTypePYTHON/scriptType
-timeout600/timeout
-  /commandScript
-/customCommand
-  /customCommands
 /component
 
 component

http://git-wip-us.apache.org/repos/asf/ambari/blob/dcbdcdfa/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/hbase_regionserver.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/hbase_regionserver.py
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/hbase_regionserver.py
index 8d66dcc..e72dad4 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/hbase_regionserver.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HBASE/package/scripts/hbase_regionserver.py
@@ -57,10 +57,6 @@ class HbaseRegionServer(Script):
 env.set_params(status_params)
 pid_file = format({pid_dir}/hbase-{hbase_user}-regionserver.pid)
 check_process_status(pid_file)
-
-  def decommission(self, env):
-print Decommission not yet implemented!
-
 
 if __name__ == __main__:
   HbaseRegionServer().execute()



ambari git commit: AMBARI-8549. Rolling Upgrade: ClusterStackVersion should display only one repository version (dlysnichenko)

2014-12-08 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 0d6e0c57f - 9053513f6


AMBARI-8549. Rolling Upgrade: ClusterStackVersion should display only one 
repository version (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 9053513f66023e6d062f94e3df00e9de1791a9f0
Parents: 0d6e0c5
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Dec 8 21:50:01 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Dec 8 21:50:01 2014 +0200

--
 .../services/ClusterStackVersionService.java| 14 -
 .../ClusterStackVersionResourceProvider.java| 63 
 .../HostStackVersionResourceProvider.java   | 47 ---
 .../RepositoryVersionResourceProvider.java  |  6 +-
 .../org/apache/ambari/server/state/Cluster.java |  7 +++
 .../server/state/cluster/ClusterImpl.java   | 38 ++--
 ...ClusterStackVersionResourceProviderTest.java |  3 +-
 7 files changed, 121 insertions(+), 57 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9053513f/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterStackVersionService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterStackVersionService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterStackVersionService.java
index 97d3bde..406e255 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterStackVersionService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterStackVersionService.java
@@ -85,20 +85,6 @@ public class ClusterStackVersionService extends BaseService {
   }
 
   /**
-   * Handles ANY /{stackVersionId}/repository_versions requests.
-   *
-   * @param stackVersionId cluster stack version id
-   * @return repository version service
-   */
-  @Path({stackVersionId}/repository_versions)
-  public RepositoryVersionService 
getRepositoryVersionHandler(@PathParam(stackVersionId) String stackVersionId) 
{
-final MapResource.Type, String stackVersionProperties = new 
HashMapResource.Type, String();
-stackVersionProperties.put(Resource.Type.Cluster, clusterName);
-stackVersionProperties.put(Resource.Type.ClusterStackVersion, 
stackVersionId);
-return new RepositoryVersionService(stackVersionProperties);
-  }
-
-  /**
* Handles: POST /{clustername}/stack_versions requests
* Distribute repositories/install packages.
*

http://git-wip-us.apache.org/repos/asf/ambari/blob/9053513f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
index a12bd29..1c2297b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java
@@ -84,10 +84,7 @@ public class ClusterStackVersionResourceProvider extends 
AbstractControllerResou
   protected static final String CLUSTER_STACK_VERSION_VERSION_PROPERTY_ID  
= PropertyHelper.getPropertyId(ClusterStackVersions, version);
   protected static final String CLUSTER_STACK_VERSION_STATE_PROPERTY_ID
= PropertyHelper.getPropertyId(ClusterStackVersions, state);
   protected static final String CLUSTER_STACK_VERSION_HOST_STATES_PROPERTY_ID  
= PropertyHelper.getPropertyId(ClusterStackVersions, host_states);
-
-  protected static final String STACK_VERSION_REPO_VERSION_PROPERTY_ID = 
PropertyHelper.getPropertyId(StackVersion, repository_version);
-  protected static final String STACK_VERSION_STACK_PROPERTY_ID= 
PropertyHelper.getPropertyId(StackVersion, stack);
-  protected static final String STACK_VERSION_VERSION_PROPERTY_ID= 
PropertyHelper.getPropertyId(StackVersion, version);
+  protected static final String 
CLUSTER_STACK_VERSION_REPOSITORY_VERSION_PROPERTY_ID   = 
PropertyHelper.getPropertyId(ClusterStackVersions, repository_version);
 
   protected static final String INSTALL_PACKAGES_ACTION = install_packages;
   protected static final String INSTALL_PACKAGES_FULL_NAME = Distribute 
repositories/install 

ambari git commit: AMBARI-8613. Repository Version Management - Fix ignored tests (yshylov via dlysnichenko)

2014-12-10 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk b1853c2f4 - e148fca5a


AMBARI-8613. Repository Version Management - Fix ignored tests (yshylov via 
dlysnichenko)


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

Branch: refs/heads/trunk
Commit: e148fca5aadff1f8720de8285d700c1fde7f8a7b
Parents: b1853c2
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Dec 10 15:57:24 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Dec 10 15:58:36 2014 +0200

--
 .../resources/BaseStacksResourceDefinition.java |  6 ++-
 .../OperatingSystemResourceProvider.java|  4 +-
 .../internal/RepositoryResourceProvider.java|  4 +-
 .../RepositoryVersionResourceProvider.java  | 40 +++-
 .../orm/entities/RepositoryVersionEntity.java   | 15 +---
 .../ambari/server/api/query/QueryImplTest.java  |  7 +---
 .../internal/ClusterControllerImplTest.java | 32 
 .../RepositoryVersionResourceProviderTest.java  |  8 ++--
 .../controller/internal/RequestImplTest.java|  5 +--
 9 files changed, 72 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e148fca5/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseStacksResourceDefinition.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseStacksResourceDefinition.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseStacksResourceDefinition.java
index a3a8261..6bff79c 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseStacksResourceDefinition.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/resources/BaseStacksResourceDefinition.java
@@ -41,7 +41,7 @@ public abstract class BaseStacksResourceDefinition extends 
BaseResourceDefinitio
 return Collections.PostProcessorsingletonList(new StacksHrefProcessor());
   }
 
-  private class StacksHrefProcessor extends BaseHrefPostProcessor {
+  private class StacksHrefProcessor extends BaseHrefPostProcessor { 
 @Override
 /**
  * If processing a /stacks or /stack_versions endpoint, replace the 
endpoint names.
@@ -57,7 +57,9 @@ public abstract class BaseStacksResourceDefinition extends 
BaseResourceDefinitio
 
 // The UI currently expects the old sub-resource names so don't do 
replacement
 // if the href contains _= as only the UI uses this syntax.
-if (! href.contains(_=)) {
+// UPD: added another hotfix to properly rename subresources for 
stack_versions and repository_versions,
+// it is backward compatible with old fix 
+if (! href.contains(_=) || href.contains(/stack_versions/) || 
href.contains(/repository_versions/)) {
   renameChildren(resultNode);
 }
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/e148fca5/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
index 682d8bd..b656def 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OperatingSystemResourceProvider.java
@@ -55,7 +55,7 @@ public class OperatingSystemResourceProvider extends 
ReadOnlyResourceProvider {
   };
 
   @SuppressWarnings(serial)
-  private static SetString propertyIds = new HashSetString() {
+  public static SetString propertyIds = new HashSetString() {
 {
   add(OPERATING_SYSTEM_OS_TYPE_PROPERTY_ID);
   add(OPERATING_SYSTEM_STACK_NAME_PROPERTY_ID);
@@ -65,7 +65,7 @@ public class OperatingSystemResourceProvider extends 
ReadOnlyResourceProvider {
   };
 
   @SuppressWarnings(serial)
-  private static MapType, String keyPropertyIds = new HashMapType, 
String() {
+  public static MapType, String keyPropertyIds = new HashMapType, String() 
{
 {
   put(Resource.Type.OperatingSystem, OPERATING_SYSTEM_OS_TYPE_PROPERTY_ID);
   put(Resource.Type.Stack, OPERATING_SYSTEM_STACK_NAME_PROPERTY_ID);

http://git-wip-us.apache.org/repos/asf/ambari/blob/e148fca5/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryResourceProvider.java

ambari git commit: AMBARI-8639. Distribute Repository/Install: parallel install not working (dlysnichenko)

2014-12-10 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 96b7f56fe - b60f26ee9


AMBARI-8639. Distribute Repository/Install: parallel install not working 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: b60f26ee9a3ae20a37e49f0158e581862643ef86
Parents: 96b7f56
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Dec 10 10:46:26 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Dec 10 18:39:55 2014 +0200

--
 .../resource_management/TestPackageResource.py  | 12 +
 .../core/providers/package/__init__.py  |  4 +-
 .../core/providers/package/apt.py   |  6 +--
 .../core/providers/package/yumrpm.py| 14 --
 .../core/providers/package/zypper.py|  6 +--
 .../core/resources/packaging.py |  4 ++
 .../ClusterStackVersionResourceProvider.java| 32 +++--
 .../HostStackVersionResourceProvider.java   |  5 +-
 .../custom_actions/scripts/install_packages.py  | 17 ---
 .../custom_actions/TestInstallPackages.py   | 50 ++--
 .../configs/install_packages_config.json|  4 +-
 11 files changed, 94 insertions(+), 60 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b60f26ee/ambari-agent/src/test/python/resource_management/TestPackageResource.py
--
diff --git 
a/ambari-agent/src/test/python/resource_management/TestPackageResource.py 
b/ambari-agent/src/test/python/resource_management/TestPackageResource.py
index 140dda9..a357d46 100644
--- a/ambari-agent/src/test/python/resource_management/TestPackageResource.py
+++ b/ambari-agent/src/test/python/resource_management/TestPackageResource.py
@@ -90,6 +90,18 @@ class TestPackageResource(TestCase):
 
   @patch.object(shell, call, new = MagicMock(return_value=(0, None)))
   @patch.object(shell, checked_call)
+  @patch.object(System, os_family, new = 'redhat')
+  def test_action_install_use_repos_rhel(self, shell_mock):
+with Environment('/') as env:
+  Package(some_package, use_repos=['HDP-UTILS-2.2.0.1-885', 
'HDP-2.2.0.1-885']
+  )
+self.assertEquals(shell_mock.call_args[0][0],
+  ['/usr/bin/yum', '-d', '0', '-e', '0', '-y', 'install',
+   '--disablerepo=*',
+   '--enablerepo=HDP-UTILS-2.2.0.1-885,HDP-2.2.0.1-885', 
'some_package'])
+
+  @patch.object(shell, call, new = MagicMock(return_value=(0, None)))
+  @patch.object(shell, checked_call)
   @patch.object(System, os_family, new = 'suse')
   def test_action_install_existent_suse(self, shell_mock):
 with Environment('/') as env:

http://git-wip-us.apache.org/repos/asf/ambari/blob/b60f26ee/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py
 
b/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py
index 5ab2b27..e1c06bb 100644
--- 
a/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py
+++ 
b/ambari-common/src/main/python/resource_management/core/providers/package/__init__.py
@@ -37,11 +37,11 @@ class PackageProvider(Provider):
 
   def action_install(self):
 package_name = self.get_package_name_with_version()
-self.install_package(package_name)
+self.install_package(package_name, self.resource.use_repos)
 
   def action_upgrade(self):
 package_name = self.get_package_name_with_version()
-self.upgrade_package(package_name)
+self.upgrade_package(package_name, self.resource.use_repos)
 
   def action_remove(self):
 package_name = self.get_package_name_with_version()

http://git-wip-us.apache.org/repos/asf/ambari/blob/b60f26ee/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
--
diff --git 
a/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
 
b/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
index c683be5..33814d8 100644
--- 
a/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
+++ 
b/ambari-common/src/main/python/resource_management/core/providers/package/apt.py
@@ -40,7 +40,7 @@ def replace_underscores(function_to_decorate):
 class AptProvider(PackageProvider):
 
   @replace_underscores
-  def install_package(self, name):
+  def 

ambari git commit: AMBARI-8639. Distribute Repository/Install: parallel install not working. Fix unit test (dlysnichenko)

2014-12-10 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk d2bc0ac81 - bf2e51900


AMBARI-8639. Distribute Repository/Install: parallel install not working. Fix 
unit test (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: bf2e5190078fd68a4d4dcd3a8f5064623dab1bf4
Parents: d2bc0ac
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Dec 10 22:12:34 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Dec 10 22:16:07 2014 +0200

--
 .../custom_actions/TestInstallPackages.py   | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/bf2e5190/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
--
diff --git 
a/ambari-server/src/test/python/custom_actions/TestInstallPackages.py 
b/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
index b87569a..c7ec155 100644
--- a/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
+++ b/ambari-server/src/test/python/custom_actions/TestInstallPackages.py
@@ -60,13 +60,13 @@ class TestInstallPackages(RMFTestCase):
   repo_file_name='HDP-2.2.0.1-885',
   mirror_list=None,
 )
-self.assertResourceCalled('Package', 'hadoop_2_2_*', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-self.assertResourceCalled('Package', 'snappy', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-self.assertResourceCalled('Package', 'snappy-devel', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-self.assertResourceCalled('Package', 'lzo', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-self.assertResourceCalled('Package', 'hadooplzo_2_2_*', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-self.assertResourceCalled('Package', 'hadoop_2_2_*-libhdfs', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-self.assertResourceCalled('Package', 'ambari-log4j', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+self.assertResourceCalled('Package', 'hadoop_2_2_*', use_repos=['base', 
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+self.assertResourceCalled('Package', 'snappy', use_repos=['base', 
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+self.assertResourceCalled('Package', 'snappy-devel', use_repos=['base', 
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+self.assertResourceCalled('Package', 'lzo', use_repos=['base', 
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+self.assertResourceCalled('Package', 'hadooplzo_2_2_*', use_repos=['base', 
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+self.assertResourceCalled('Package', 'hadoop_2_2_*-libhdfs', 
use_repos=['base', 'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+self.assertResourceCalled('Package', 'ambari-log4j', use_repos=['base', 
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
 self.assertNoMoreResources()
 
 
@@ -102,13 +102,13 @@ class TestInstallPackages(RMFTestCase):
   repo_file_name='HDP-2.2.0.1-885',
   mirror_list=None,
 )
-self.assertResourceCalled('Package', 'hadoop_2_2_*', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-self.assertResourceCalled('Package', 'snappy', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-self.assertResourceCalled('Package', 'snappy-devel', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-self.assertResourceCalled('Package', 'lzo', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-self.assertResourceCalled('Package', 'hadooplzo_2_2_*', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-self.assertResourceCalled('Package', 'hadoop_2_2_*-libhdfs', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
-self.assertResourceCalled('Package', 'ambari-log4j', 
use_repos=['HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+self.assertResourceCalled('Package', 'hadoop_2_2_*', use_repos=['base', 
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+self.assertResourceCalled('Package', 'snappy', use_repos=['base', 
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+self.assertResourceCalled('Package', 'snappy-devel', use_repos=['base', 
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+self.assertResourceCalled('Package', 'lzo', use_repos=['base', 
'HDP-UTILS-2.2.0.1-885', 'HDP-2.2.0.1-885'])
+self.assertResourceCalled('Package', 'hadooplzo_2_2_*', use_repos=['base', 
'HDP-UTILS-2.2.0.1-885', 

ambari git commit: AMBARI-8591. Configs: Enabling Yarn RM HA through Ambari should enable work preserving RM restart (dlysnichenko)

2014-12-11 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 4772593c5 - 400b1af7e


AMBARI-8591. Configs: Enabling Yarn RM HA through Ambari should enable work 
preserving RM restart (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 400b1af7e0c417cebe95257f3dc8cb9fbb91b415
Parents: 4772593
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Dec 11 19:29:28 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Dec 11 19:29:28 2014 +0200

--
 .../stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/400b1af7/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
index c480566..c47abef 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/YARN/configuration/yarn-site.xml
@@ -42,7 +42,7 @@
   /property
   property
 nameyarn.nodemanager.recovery.enabled/name
-valuefalse/value
+valuetrue/value
 descriptionEnable the node manager to recover after 
starting/description
   /property
   property
@@ -65,7 +65,7 @@
   /property
   property
 nameyarn.resourcemanager.recovery.enabled/name
-valuefalse/value
+valuetrue/value
 description
   Enable RM to recover state after starting.
   If true, then yarn.resourcemanager.store.class must be specified.
@@ -73,7 +73,7 @@
   /property
   property
 nameyarn.resourcemanager.work-preserving-recovery.enabled/name
-valuefalse/value
+valuetrue/value
 description
   Enable RM work preserving recovery. This configuration is private to 
YARN for experimenting the feature.
 /description



ambari git commit: AMBARI-8661. Distribute Repositories/Install Components - fix missing INSTALLING-INSTALL_FAILED transition on multinode cluster (dlysnichenko)

2014-12-11 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 298d8109a - 4e04189d7


AMBARI-8661. Distribute Repositories/Install Components - fix missing 
INSTALLING-INSTALL_FAILED transition on multinode cluster (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 4e04189d7071b44b74ced36801cb157416373bb1
Parents: 298d810
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Dec 11 18:14:54 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Dec 11 19:48:54 2014 +0200

--
 .../org/apache/ambari/server/state/cluster/ClusterImpl.java   | 5 -
 .../ambari/server/actionmanager/TestActionScheduler.java  | 7 +++
 .../internal/ClusterStackVersionResourceProviderTest.java | 4 ++--
 3 files changed, 9 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4e04189d/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 9848069..ed9b0e7 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -1263,8 +1263,11 @@ public class ClusterImpl implements Cluster {
 throw new AmbariException(String.format(Repo version %s is not 
installed on host %s,
 repositoryVersion, hostName));
   }
-  if (hostVersion.getState() != worstState) {
+  if (hostVersion.getState() == RepositoryVersionState.INSTALL_FAILED) 
{
 worstState = hostVersion.getState();
+break;
+  } else if (hostVersion.getState() == 
RepositoryVersionState.INSTALLING) {
+worstState = RepositoryVersionState.INSTALLING;
   }
 }
 if (worstState != clusterVersion.getState()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/4e04189d/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
index b389644..d14f126 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
@@ -263,7 +263,6 @@ public class TestActionScheduler {
 
   }
 
-  @Ignore
   @Test
   public void testActionTimeoutForLostHost() throws Exception {
 ActionQueue aq = new ActionQueue();
@@ -314,9 +313,10 @@ public class TestActionScheduler {
 }).when(db).timeoutHostRole(anyString(), anyLong(), anyLong(), 
anyString());
 
 //Small action timeout to test rescheduling
+AmbariEventPublisher aep = 
EasyMock.createNiceMock(AmbariEventPublisher.class);
 ActionScheduler scheduler = 
EasyMock.createMockBuilder(ActionScheduler.class).
 withConstructor((long) 100, (long) 50, db, aq, fsm, 3,
-new HostsMap((String) null), unitOfWork, 
EasyMock.anyObject(AmbariEventPublisher.class), null, conf).
+new HostsMap((String) null), unitOfWork, aep, conf).
 addMockedMethod(cancelHostRoleCommands).
 createMock();
 
scheduler.cancelHostRoleCommands((CollectionHostRoleCommand)EasyMock.anyObject(),EasyMock.anyObject(String.class));
@@ -1006,7 +1006,6 @@ public class TestActionScheduler {
 Assert.assertEquals(HostRoleStatus.QUEUED, 
stages.get(1).getHostRoleStatus(hostname1, GANGLIA_MONITOR));
   }
 
-  @Ignore
   @Test
   public void testRequestFailureOnStageFailure() throws Exception {
 ActionQueue aq = new ActionQueue();
@@ -1116,7 +1115,7 @@ public class TestActionScheduler {
 ActionScheduler scheduler = 
EasyMock.createMockBuilder(ActionScheduler.class).
 withConstructor((long)100, (long)50, db, aq, fsm, 3,
   new HostsMap((String) null),
-  unitOfWork, null, conf).
+  unitOfWork, EasyMock.createNiceMock(AmbariEventPublisher.class), 
conf).
   addMockedMethod(cancelHostRoleCommands).
   createMock();
 scheduler.cancelHostRoleCommands(EasyMock.capture(cancelCommandList),


[2/2] ambari git commit: AMBARI-8718. Repository Version Management Create relation between repo_version and stack_version (yshylov via dlysnichenko)

2014-12-17 Thread dmitriusan
AMBARI-8718. Repository Version Management  Create relation between 
repo_version and stack_version (yshylov via dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 92815dd588597842a02d3143657554a8085d880e
Parents: 97115a7
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Dec 17 18:30:19 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Dec 17 18:30:19 2014 +0200

--
 .../server/api/services/StacksService.java  |  50 -
 .../ClusterStackVersionResourceProvider.java|   7 +-
 .../HostStackVersionResourceProvider.java   |   4 +-
 .../DistributeRepositoriesActionListener.java   |   6 +-
 .../orm/entities/ClusterVersionEntity.java  |  87 
 .../server/orm/entities/HostVersionEntity.java  | 101 +--
 .../server/state/cluster/ClusterImpl.java   |  22 ++--
 .../ambari/server/state/stack/UpgradePack.java  |   2 +-
 .../server/upgrade/UpgradeCatalog200.java   |  31 ++
 .../main/resources/Ambari-DDL-MySQL-CREATE.sql  |   8 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |   8 +-
 .../resources/Ambari-DDL-Postgres-CREATE.sql|   8 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql |   8 +-
 .../resources/Ambari-DDL-SQLServer-CREATE.sql   |   6 +-
 .../server/agent/TestHeartbeatHandler.java  |   4 +
 .../server/agent/TestHeartbeatMonitor.java  |   9 +-
 .../server/api/services/StacksServiceTest.java  |  13 ---
 .../AmbariManagementControllerTest.java |  12 +++
 .../StackDefinedPropertyProviderTest.java   |   9 +-
 .../internal/UpgradeResourceProviderTest.java   |   7 +-
 .../apache/ambari/server/events/EventsTest.java |   5 +
 .../apache/ambari/server/orm/OrmTestHelper.java |  24 +
 .../server/orm/dao/ClusterVersionDAOTest.java   |  16 +--
 .../server/orm/dao/HostVersionDAOTest.java  |  61 ++-
 .../server/state/ServiceComponentTest.java  |   8 +-
 .../ambari/server/state/UpgradeHelperTest.java  |   7 +-
 .../server/state/cluster/ClusterTest.java   |  64 ++--
 .../server/state/cluster/ClustersTest.java  |  40 
 .../ambari/server/state/host/HostTest.java  |  49 +
 .../svccomphost/ServiceComponentHostTest.java   |   8 ++
 .../server/upgrade/UpgradeCatalog200Test.java   |   4 +-
 31 files changed, 358 insertions(+), 330 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/92815dd5/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
index 4d0fb31..cdadfd9 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/StacksService.java
@@ -250,46 +250,6 @@ public class StacksService extends BaseService {
 return new RepositoryVersionService(stackProperties);
   }
 
-  @GET
-  
@Path({stackName}/versions/{stackVersion}/repository_versions/{repositoryVersionId}/operating_systems/{osType}/repositories)
-  @Produces(text/plain)
-  public Response getRepositories(String body, @Context HttpHeaders headers, 
@Context UriInfo ui, @PathParam(stackName) String stackName,
-  @PathParam(stackVersion) String stackVersion, 
@PathParam(repositoryVersionId) String repositoryVersionId, 
@PathParam(osType) String osType) {
-
-return handleRequest(headers, body, new StackUriInfo(ui), 
Request.Type.GET, createRepositoryResource(stackName, stackVersion, 
repositoryVersionId, osType, null));
-  }
-
-  @GET
-  
@Path({stackName}/versions/{stackVersion}/repository_versions/{repositoryVersionId}/operating_systems/{osType}/repositories/{repoId})
-  @Produces(text/plain)
-  public Response getRepository(String body, @Context HttpHeaders headers, 
@Context UriInfo ui, @PathParam(stackName) String stackName,
-  @PathParam(stackVersion) String stackVersion, 
@PathParam(repositoryVersionId) String repositoryVersionId, 
@PathParam(osType) String osType, @PathParam(repoId) String repoId) {
-
-return handleRequest(headers, body, new StackUriInfo(ui), 
Request.Type.GET, createRepositoryResource(stackName, stackVersion, 
repositoryVersionId, osType, repoId));
-  }
-
-  ResourceInstance createRepositoryVersionResource(String stackName, String 
stackVersion,
-   String repositoryVersionId) 
{
-   

[1/2] ambari git commit: AMBARI-8718. Repository Version Management Create relation between repo_version and stack_version (yshylov via dlysnichenko)

2014-12-17 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 97115a760 - 92815dd58


http://git-wip-us.apache.org/repos/asf/ambari/blob/92815dd5/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/HostVersionDAOTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/HostVersionDAOTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/HostVersionDAOTest.java
index 44bdf94..532ad33 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/HostVersionDAOTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/HostVersionDAOTest.java
@@ -21,8 +21,10 @@ package org.apache.ambari.server.orm.dao;
 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.persist.PersistService;
+
 import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
+import org.apache.ambari.server.orm.OrmTestHelper;
 import org.apache.ambari.server.orm.entities.*;
 import org.apache.ambari.server.state.RepositoryVersionState;
 import org.junit.After;
@@ -46,6 +48,7 @@ public class HostVersionDAOTest {
   private ClusterVersionDAO clusterVersionDAO;
   private HostDAO hostDAO;
   private HostVersionDAO hostVersionDAO;
+  private OrmTestHelper helper;
 
   @Before
   public void before() {
@@ -57,6 +60,7 @@ public class HostVersionDAOTest {
 clusterVersionDAO = injector.getInstance(ClusterVersionDAO.class);
 hostDAO = injector.getInstance(HostDAO.class);
 hostVersionDAO = injector.getInstance(HostVersionDAO.class);
+helper = injector.getInstance(OrmTestHelper.class);
 
 createDefaultData();
   }
@@ -81,7 +85,7 @@ public class HostVersionDAOTest {
 clusterDAO.create(clusterEntity);
 
 // Create the Cluster Version and link it to the cluster
-ClusterVersionEntity clusterVersionEntity = new 
ClusterVersionEntity(clusterEntity, HDP, 2.2.0.0-995, 
RepositoryVersionState.CURRENT, System.currentTimeMillis(), 
System.currentTimeMillis(), admin);
+ClusterVersionEntity clusterVersionEntity = new 
ClusterVersionEntity(clusterEntity, 
helper.getOrCreateRepositoryVersion(HDP-2.2, 2.2.0.0-995), 
RepositoryVersionState.CURRENT, System.currentTimeMillis(), 
System.currentTimeMillis(), admin);
 ListClusterVersionEntity clusterVersionEntities = new 
ArrayListClusterVersionEntity();
 clusterVersionEntities.add(clusterVersionEntity);
 clusterEntity.setClusterVersionEntities(clusterVersionEntities);
@@ -118,9 +122,9 @@ public class HostVersionDAOTest {
 clusterDAO.merge(clusterEntity);
 
 // Create the Host Versions
-HostVersionEntity hostVersionEntity1 = new 
HostVersionEntity(host1.getHostName(), clusterVersionEntity.getStack(), 
clusterVersionEntity.getVersion(), RepositoryVersionState.CURRENT);
-HostVersionEntity hostVersionEntity2 = new 
HostVersionEntity(host2.getHostName(), clusterVersionEntity.getStack(), 
clusterVersionEntity.getVersion(), RepositoryVersionState.INSTALLED);
-HostVersionEntity hostVersionEntity3 = new 
HostVersionEntity(host3.getHostName(), clusterVersionEntity.getStack(), 
clusterVersionEntity.getVersion(), RepositoryVersionState.INSTALLED);
+HostVersionEntity hostVersionEntity1 = new 
HostVersionEntity(host1.getHostName(), 
clusterVersionEntity.getRepositoryVersion(), RepositoryVersionState.CURRENT);
+HostVersionEntity hostVersionEntity2 = new 
HostVersionEntity(host2.getHostName(), 
clusterVersionEntity.getRepositoryVersion(), RepositoryVersionState.INSTALLED);
+HostVersionEntity hostVersionEntity3 = new 
HostVersionEntity(host3.getHostName(), 
clusterVersionEntity.getRepositoryVersion(), RepositoryVersionState.INSTALLED);
 hostVersionEntity1.setHostEntity(host1);
 hostVersionEntity2.setHostEntity(host2);
 hostVersionEntity3.setHostEntity(host3);
@@ -145,7 +149,7 @@ public class HostVersionDAOTest {
   Assert.fail(Cluster is expected to have at least one cluster version);
 }
 
-ClusterVersionEntity newClusterVersionEntity = new 
ClusterVersionEntity(clusterEntity, HDP, 2.2.0.1-996, 
RepositoryVersionState.CURRENT, System.currentTimeMillis(), 
System.currentTimeMillis(), admin);
+ClusterVersionEntity newClusterVersionEntity = new 
ClusterVersionEntity(clusterEntity, 
helper.getOrCreateRepositoryVersion(HDP-2.2, 2.2.0.1-996), 
RepositoryVersionState.CURRENT, System.currentTimeMillis(), 
System.currentTimeMillis(), admin);
 clusterEntity.addClusterVersionEntity(newClusterVersionEntity);
 clusterVersionDAO.create(newClusterVersionEntity);
 
@@ -155,7 +159,7 @@ public class HostVersionDAOTest {
 
 // For each of the hosts, add a host version
 for (HostEntity host : hostEntities) {
-  HostVersionEntity hostVersionEntity = new 
HostVersionEntity(host.getHostName(), HDP, 2.2.0.1-996, 
RepositoryVersionState.INSTALLED);
+  HostVersionEntity hostVersionEntity 

ambari git commit: AMBARI-8767. Update metainfo.xml on HDP-2.2 services so that they don't have the minor version hardcoded (dlysnichenko)

2014-12-17 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 7f3b8e9f6 - 75cdb28b8


AMBARI-8767. Update metainfo.xml on HDP-2.2 services so that they don't have 
the minor version hardcoded (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 75cdb28b8011648d9946802ba49eb09597ac5ef5
Parents: 7f3b8e9
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Dec 17 21:19:02 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Dec 17 21:41:25 2014 +0200

--
 .../main/resources/stacks/HDP/2.2/services/FALCON/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.2/services/FLUME/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.2/services/HBASE/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml | 2 +-
 .../src/main/resources/stacks/HDP/2.2/services/HIVE/metainfo.xml | 2 +-
 .../main/resources/stacks/HDP/2.2/services/KAFKA/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.2/services/KNOX/metainfo.xml | 2 +-
 .../main/resources/stacks/HDP/2.2/services/OOZIE/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.2/services/PIG/metainfo.xml  | 2 +-
 .../main/resources/stacks/HDP/2.2/services/SLIDER/metainfo.xml   | 2 +-
 .../main/resources/stacks/HDP/2.2/services/SQOOP/metainfo.xml| 2 +-
 .../main/resources/stacks/HDP/2.2/services/STORM/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.2/services/TEZ/metainfo.xml  | 2 +-
 .../src/main/resources/stacks/HDP/2.2/services/YARN/metainfo.xml | 4 ++--
 .../resources/stacks/HDP/2.2/services/ZOOKEEPER/metainfo.xml | 2 +-
 15 files changed, 16 insertions(+), 16 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/75cdb28b/ambari-server/src/main/resources/stacks/HDP/2.2/services/FALCON/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/FALCON/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/FALCON/metainfo.xml
index 20d9098..fe41949 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/FALCON/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/FALCON/metainfo.xml
@@ -21,7 +21,7 @@
 service
   nameFALCON/name
   displayNameFalcon/displayName
-  version0.6.0.2.2.0.0/version
+  version0.6.0.2.2/version
   osSpecifics
 osSpecific
   osFamilyredhat5,redhat6,suse11/osFamily

http://git-wip-us.apache.org/repos/asf/ambari/blob/75cdb28b/ambari-server/src/main/resources/stacks/HDP/2.2/services/FLUME/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/FLUME/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/FLUME/metainfo.xml
index c5b38b3..77afa94 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/FLUME/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/FLUME/metainfo.xml
@@ -21,7 +21,7 @@
 service
   nameFLUME/name
   displayNameFlume/displayName
-  version1.5.2.2.2.0.0/version
+  version1.5.2.2.2/version
 
   osSpecifics
 osSpecific

http://git-wip-us.apache.org/repos/asf/ambari/blob/75cdb28b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/metainfo.xml
index 9b357d0..c632cd0 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/metainfo.xml
@@ -21,7 +21,7 @@
 service
   nameHBASE/name
   displayNameHBase/displayName
-  version0.98.4.2.2.0.0/version
+  version0.98.4.2.2/version
 
   osSpecifics
 osSpecific

http://git-wip-us.apache.org/repos/asf/ambari/blob/75cdb28b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
index 5d1fe99..a6dc0b9 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
@@ -21,7 

[4/4] ambari git commit: AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 stack upgrade (dlysnichenko)

2014-12-18 Thread dmitriusan
AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 
stack upgrade (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 10659055de1716a9216467325a0a940e50e2
Parents: 0e91ecb
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Dec 18 20:41:16 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Dec 18 20:41:16 2014 +0200

--
 .../src/main/python/UpgradeHelper_HDP2.py   | 1245 --
 ambari-server/src/main/python/upgradeHelper.py  | 1183 +
 .../catalog/UpgradeCatalog_1.3_to_2.2.json  |  961 ++
 .../src/test/python/TestUpgradeHelper.py|   95 ++
 .../src/test/python/TestUpgradeScript_HDP2.py   |  646 -
 5 files changed, 2239 insertions(+), 1891 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/10659055/ambari-server/src/main/python/UpgradeHelper_HDP2.py
--
diff --git a/ambari-server/src/main/python/UpgradeHelper_HDP2.py 
b/ambari-server/src/main/python/UpgradeHelper_HDP2.py
deleted file mode 100644
index 396ec2b..000
--- a/ambari-server/src/main/python/UpgradeHelper_HDP2.py
+++ /dev/null
@@ -1,1245 +0,0 @@
-#!/usr/bin/env python
-
-'''
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-License); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an AS IS BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-'''
-
-import optparse
-from pprint import pprint
-import sys
-import datetime
-import os.path
-import logging
-import shutil
-import json
-import subprocess
-import time
-
-
-# action commands
-GET_MR_MAPPING_ACTION = save-mr-mapping
-DELETE_MR_ACTION = delete-mr
-ADD_YARN_MR2_ACTION = add-yarn-mr2
-MODIFY_CONFIG_ACTION = update-configs
-BACKUP_CONFIG_ACTION = backup-configs
-INSTALL_YARN_MR2_ACTION = install-yarn-mr2
-VALID_ACTIONS = ', '.join([GET_MR_MAPPING_ACTION, DELETE_MR_ACTION, 
ADD_YARN_MR2_ACTION, MODIFY_CONFIG_ACTION,
-   INSTALL_YARN_MR2_ACTION, BACKUP_CONFIG_ACTION])
-
-MR_MAPPING_FILE = mr_mapping
-UPGRADE_LOG_FILE = upgrade_log
-CAPACITY_SCHEDULER_TAG = capacity-scheduler
-MAPRED_SITE_TAG = mapred-site
-GLOBAL_TAG = global
-HDFS_SITE_TAG = hdfs-site
-CORE_SITE_TAG = core-site
-YARN_SITE_TAG = yarn-site
-HBASE_SITE_TAG = hbase-site
-HIVE_SITE_TAG = hive-site
-REPLACE_JH_HOST_NAME_TAG = REPLACE_JH_HOST
-REPLACE_RM_HOST_NAME_TAG = REPLACE_RM_HOST
-REPLACE_WITH_TAG = REPLACE_WITH_
-DELETE_OLD_TAG = DELETE_OLD
-
-AUTH_FORMAT = '{0}:{1}'
-ROOT_FORMAT = 'http://{0}:8080/api/v1'
-URL_FORMAT = ROOT_FORMAT+'/clusters/{1}'
-
-
-logger = logging.getLogger()
-
-# old : new
-PROPERTY_MAPPING = {
-  create.empty.dir.if.nonexist: mapreduce.jobcontrol.createdir.ifnotexist,
-  dfs.access.time.precision: dfs.namenode.accesstime.precision,
-  dfs.backup.address: dfs.namenode.backup.address,
-  dfs.backup.http.address: dfs.namenode.backup.http-address,
-  dfs.balance.bandwidthPerSec: dfs.datanode.balance.bandwidthPerSec,
-  dfs.block.size: dfs.blocksize,
-  dfs.data.dir: dfs.datanode.data.dir,
-  dfs.datanode.max.xcievers: dfs.datanode.max.transfer.threads,
-  dfs.df.interval: fs.df.interval,
-  dfs.federation.nameservice.id: dfs.nameservice.id,
-  dfs.federation.nameservices: dfs.nameservices,
-  dfs.http.address: dfs.namenode.http-address,
-  dfs.https.address: dfs.namenode.https-address,
-  dfs.https.client.keystore.resource: dfs.client.https.keystore.resource,
-  dfs.https.need.client.auth: dfs.client.https.need-auth,
-  dfs.max.objects: dfs.namenode.max.objects,
-  dfs.max-repl-streams: dfs.namenode.replication.max-streams,
-  dfs.name.dir: dfs.namenode.name.dir,
-  dfs.name.dir.restore: dfs.namenode.name.dir.restore,
-  dfs.name.edits.dir: dfs.namenode.edits.dir,
-  dfs.permissions: dfs.permissions.enabled,
-  dfs.permissions.supergroup: dfs.permissions.superusergroup,
-  dfs.read.prefetch.size: dfs.client.read.prefetch.size,
-  dfs.replication.considerLoad: 

[3/4] ambari git commit: AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 stack upgrade (dlysnichenko)

2014-12-18 Thread dmitriusan
http://git-wip-us.apache.org/repos/asf/ambari/blob/10659055/ambari-server/src/main/python/upgradeHelper.py
--
diff --git a/ambari-server/src/main/python/upgradeHelper.py 
b/ambari-server/src/main/python/upgradeHelper.py
new file mode 100644
index 000..57592ad
--- /dev/null
+++ b/ambari-server/src/main/python/upgradeHelper.py
@@ -0,0 +1,1183 @@
+#!/usr/bin/env python
+
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+License); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an AS IS BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+'''
+
+
+import getpass
+import optparse
+from pprint import pprint
+import re
+import sys
+import datetime
+import os.path
+import logging
+import shutil
+import json
+import subprocess
+import time
+
+
+# ==
+#Error classes definition
+# ==
+class FatalException(Exception):
+  def __init__(self, code, reason):
+self.code = code
+self.reason = reason
+
+  def __str__(self):
+return repr(Fatal exception: %s, exit code %s % (self.reason, self.code))
+
+  def _get_message(self):
+return str(self)
+
+
+class ReadOnlyPropertyException(Exception):
+  def __str__(self):
+return Property is read-only
+
+  def _get_message(self):
+return self.__str__()
+
+class NotSupportedCatalogVersion(Exception):
+  def __init__(self, catalog_version):
+self._version = catalog_version
+
+  def __str__(self):
+return Version %s of loaded catalog not supported % self._version
+
+  def _get_message(self):
+return self.__str__()
+
+  message = property(__str__)
+
+
+# ==
+#Constant class definition
+# ==
+class Const(object):
+  def __new__(cls, *args, **kwargs):
+raise Exception(Class couldn't be created)
+
+
+class CatConst(Const):
+  VERSION_TAG = version
+  STACK_VERSION_OLD = old-version
+  STACK_VERSION_TARGET = target-version
+  STACK_STAGS_TAG = stacks
+  STACK_NAME = name
+  CONFIG_OPTIONS = options
+  CONFIG_TYPES = config-types
+  STACK_PROPERTIES = properties
+  PROPERTY_VALUE_TAG = value
+  PROPERTY_REMOVE_TAG = remove
+  MERGED_COPY_TAG = merged-copy
+  ITEMS_TAG = items
+  TYPE_TAG = type
+  TRUE_TAG = yes
+  STACK_PROPERTIES_MAPPING_LIST_TAG = property-mapping
+  VALUE_TEMPLATE_TAG = template
+  SEARCH_PATTERN = (\{[^\{\}]+\})  # {X}
+
+
+class Options(Const):
+  # action commands
+  API_PROTOCOL = http
+  API_PORT = 8080
+
+  GET_MR_MAPPING_ACTION = save-mr-mapping
+  VERIFY_ACTION = verify
+  DELETE_MR_ACTION = delete-mr
+  ADD_YARN_MR2_ACTION = add-yarn-mr2
+  MODIFY_CONFIG_ACTION = update-configs
+  BACKUP_CONFIG_ACTION = backup-configs
+  INSTALL_YARN_MR2_ACTION = install-yarn-mr2
+
+  MR_MAPPING_FILE = mr_mapping
+  CAPACITY_SCHEDULER_TAG = capacity-scheduler
+  REPLACE_JH_HOST_NAME_TAG = REPLACE_JH_HOST
+  REPLACE_RM_HOST_NAME_TAG = REPLACE_RM_HOST
+  REPLACE_WITH_TAG = REPLACE_WITH_
+  DELETE_OLD_TAG = DELETE_OLD
+
+  ZOOKEEPER_SERVER = ZOOKEEPER_SERVER
+
+  MR_MAPPING = None
+  logger = None
+
+  # Api constants
+  ROOT_URL = None
+  CLUSTER_URL = None
+  COMPONENTS_FORMAT = None
+
+  # Curl options
+  POST_REQUESTS = ['PUT', 'POST']
+  GET_REQUESTS = ['GET', 'DELETE']
+  CURL_PRINT_ONLY = None
+
+  ARGS = None
+  OPTIONS = None
+  HOST = None
+  CLUSTER_NAME = None
+
+  # for verify action
+  REPORT_FILE = None
+
+  API_TOKENS = {
+user: None,
+pass: None
+  }
+
+  HEADERS = {
+'X-Requested-By': 'upgradeHelper'
+  }
+
+  @classmethod
+  def initialize(cls):
+cls.ROOT_URL = '%s://%s:%s/api/v1' % (cls.API_PROTOCOL, cls.HOST, 
cls.API_PORT)
+cls.CLUSTER_URL = cls.ROOT_URL + /clusters/%s % cls.CLUSTER_NAME
+cls.COMPONENTS_FORMAT = cls.CLUSTER_URL + /components/{0}
+
+  @classmethod
+  def initialize_logger(cls, filename=None):
+cls.logger = logging.getLogger('UpgradeHelper')
+cls.logger.setLevel(logging.DEBUG)
+
+if filename is not None:
+  handler = logging.FileHandler(filename)
+  handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s - 
%(message)s'))
+  cls.logger.addHandler(handler)
+  cls.logger.info()
+  cls.logger.info(Start new logging section)
+
+handler = logging.StreamHandler(sys.stdout)
+handler.setFormatter(logging.Formatter('%(levelname)s: %(message)s'))
+

[1/4] ambari git commit: AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 stack upgrade (dlysnichenko)

2014-12-18 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 0e91ecb83 - 106590550


http://git-wip-us.apache.org/repos/asf/ambari/blob/10659055/ambari-server/src/test/python/TestUpgradeHelper.py
--
diff --git a/ambari-server/src/test/python/TestUpgradeHelper.py 
b/ambari-server/src/test/python/TestUpgradeHelper.py
new file mode 100644
index 000..b5c6cb1
--- /dev/null
+++ b/ambari-server/src/test/python/TestUpgradeHelper.py
@@ -0,0 +1,95 @@
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+License); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an AS IS BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+'''
+
+
+from mock.mock import MagicMock, call
+from mock.mock import patch
+
+from unittest import TestCase
+import sys
+import unittest
+import upgradeHelper
+import StringIO
+import logging
+
+
+class TestUpgradeHelper(TestCase):
+  original_curl = None
+  out = None
+
+  def setUp(self):
+# replace original curl call to mock
+self.original_curl = upgradeHelper.curl
+upgradeHelper.curl = self.magic_curl
+
+# mock logging methods
+upgradeHelper.logging.getLogger = MagicMock()
+upgradeHelper.logging.FileHandler = MagicMock()
+
+self.out = StringIO.StringIO()
+sys.stdout = self.out
+
+  def magic_curl(self, *args, **kwargs):
+def ret_object():
+  return 
+
+def communicate():
+  return {}, 
+
+ret_object.returncode = 0
+ret_object.communicate = communicate
+
+with patch(upgradeHelper.subprocess) as subprocess:
+  subprocess.Popen.return_value = ret_object
+  self.original_curl(*args, **kwargs)
+
+  def tearDown(self):
+sys.stdout = sys.__stdout__
+
+  @patch(optparse.OptionParser)
+  @patch(upgradeHelper.modify_configs)
+  @patch(upgradeHelper.backup_file)
+  def test_ParseOptions(self, backup_file_mock, modify_action_mock, 
option_parser_mock):
+class options(object):
+  user = test_user
+  hostname = 127.0.0.1
+  clustername = test1
+  password = test_password
+  upgrade_json = catalog_file
+  from_stack = 0.0
+  to_stack = 1.3
+  logfile = test.log
+  warnings = []
+  printonly = False
+
+args = [update-configs]
+modify_action_mock.return_value = MagicMock()
+backup_file_mock.return_value = MagicMock()
+test_mock = MagicMock()
+test_mock.parse_args = lambda: (options, args)
+option_parser_mock.return_value = test_mock
+
+upgradeHelper.main()
+self.assertEqual(backup_file_mock.call_count, 1)
+self.assertEqual(modify_action_mock.call_count, 1)
+self.assertEqual({user: options.user, pass: options.password}, 
upgradeHelper.Options.TOKENS)
+self.assertEqual(options.clustername, upgradeHelper.Options.CLUSTER_NAME)
+
+
+if __name__ == __main__:
+  unittest.main()

http://git-wip-us.apache.org/repos/asf/ambari/blob/10659055/ambari-server/src/test/python/TestUpgradeScript_HDP2.py
--
diff --git a/ambari-server/src/test/python/TestUpgradeScript_HDP2.py 
b/ambari-server/src/test/python/TestUpgradeScript_HDP2.py
deleted file mode 100644
index 36ce54c..000
--- a/ambari-server/src/test/python/TestUpgradeScript_HDP2.py
+++ /dev/null
@@ -1,646 +0,0 @@
-'''
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-License); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an AS IS BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-'''
-import subprocess
-from mock.mock import MagicMock, call, patch
-from unittest import TestCase
-from mock.mock import create_autospec
-import sys
-import unittest
-import UpgradeHelper_HDP2
-import StringIO
-import logging
-
-
-class TestUpgradeHDP2Script(TestCase):
-  def setUp(self):
-UpgradeHelper_HDP2.logger = 

[2/4] ambari git commit: AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 stack upgrade (dlysnichenko)

2014-12-18 Thread dmitriusan
http://git-wip-us.apache.org/repos/asf/ambari/blob/10659055/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
--
diff --git 
a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
 
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
new file mode 100644
index 000..5ee2816
--- /dev/null
+++ 
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
@@ -0,0 +1,961 @@
+{
+  version: 1.0,
+  stacks: [
+{
+  name: HDP,
+  old-version: 1.3,
+  target-version: 2.2,
+  options: {
+config-types: {
+  hdfs-site: {
+merged-copy: yes
+  },
+  core-site: {
+merged-copy: yes
+  },
+  hbase-site: {
+merged-copy: yes
+  },
+  hbase-env: {
+merged-copy: yes
+  },
+  oozie-env: {
+merged-copy: yes
+  },
+  hive-site: {
+merged-copy: yes
+  },
+  mapred-site: {
+merged-copy: yes
+  },
+  mapred-env: {
+merged-copy: yes
+  },
+  cluster-env : {
+merged-copy: yes
+  },
+  sqoop-env: {
+merged-copy: yes
+  },
+  pig-env: {
+merged-copy: yes
+  },
+  pig-properties: {
+merged-copy: yes
+  },
+  webhcat-site: {
+merged-copy: yes
+  },
+  zookeeper-env: {
+merged-copy: yes
+  },
+  hadoop-env: {
+merged-copy: yes
+  },
+  hadoop-policy: {
+merged-copy: yes
+  },
+  hbase-log4j: {
+merged-copy: yes
+  },
+  hdfs-log4j: {
+merged-copy: yes
+  },
+  hive-env: {
+merged-copy: yes
+  },
+  hive-exec-log4j: {
+merged-copy: yes
+  },
+  hive-log4j: {
+merged-copy: yes
+  },
+  oozie-site: {
+merged-copy: yes
+  }
+}
+  },
+  properties: {
+oozie-site: {
+  oozie.service.ProxyUserService.proxyuser.falcon.hosts: *,
+  oozie.service.coord.check.maximum.frequency: false,
+  oozie.service.SchemaService.wf.ext.schemas: 
shell-action-0.1.xsd,shell-action-0.2.xsd,shell-action-0.3.xsd,email-action-0.1.xsd,email-action-0.2.xsd,hive-action-0.2.xsd,hive-action-0.3.xsd,hive-action-0.4.xsd,hive-action-0.5.xsd,sqoop-action-0.2.xsd,sqoop-action-0.3.xsd,sqoop-action-0.4.xsd,ssh-action-0.1.xsd,ssh-action-0.2.xsd,distcp-action-0.1.xsd,distcp-action-0.2.xsd,oozie-sla-0.1.xsd,oozie-sla-0.2.xsd,
+  oozie.service.HadoopAccessorService.kerberos.enabled: false,
+  oozie.service.coord.push.check.requeue.interval: 3,
+  oozie.credentials.credentialclasses: 
hcat=org.apache.oozie.action.hadoop.HCatCredentials,
+  oozie.authentication.kerberos.name.rules: \n  
RULE:[2:$1@$0]([jt]t@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-MAPREDUSER/\n  
RULE:[2:$1@$0]([nd]n@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HDFSUSER/\n  
RULE:[2:$1@$0](hm@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n  
RULE:[2:$1@$0](rs@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n  DEFAULT,
+  oozie.authentication.simple.anonymous.allowed: true,
+  oozie.service.AuthorizationService.security.enabled: true,
+  oozie.services.ext: 
org.apache.oozie.service.JMSAccessorService,org.apache.oozie.service.PartitionDependencyManagerService,org.apache.oozie.service.HCatAccessorService,
+  oozie.services: \n  
org.apache.oozie.service.SchedulerService,\n  
org.apache.oozie.service.InstrumentationService,\n  
org.apache.oozie.service.MemoryLocksService,\n  
org.apache.oozie.service.UUIDService,\n  
org.apache.oozie.service.ELService,\n  
org.apache.oozie.service.AuthorizationService,\n  
org.apache.oozie.service.UserGroupInformationService,\n  
org.apache.oozie.service.HadoopAccessorService,\n  
org.apache.oozie.service.JobsConcurrencyService,\n  
org.apache.oozie.service.URIHandlerService,\n  
org.apache.oozie.service.DagXLogInfoService,\n  
org.apache.oozie.service.SchemaService,\n  
org.apache.oozie.service.LiteWorkflowAppService,\n  
org.apache.oozie.service.JPAService,\n  
org.apache.oozie.service.StoreService,\n  
org.apache.oozie.service.CoordinatorStoreService,\n  
org.apache.oozie.service.SLAStoreService,\n  
org.apache.oozie.service.DBLiteWorkflowStoreService,\n  
org.apache.oozie.service.C
 allbackService,\n  org.apache.oozie.service.ShareLibService,\n  
org.apache.oozie.service.CallableQueueService,\n  
org.apache.oozie.service.ActionService,\n  

[4/4] ambari git commit: AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 stack upgrade (dlysnichenko)

2014-12-18 Thread dmitriusan
AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 
stack upgrade (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: c2b9a1a72c434aceef7e905c86e85adf61f4cfd9
Parents: 68f9cb8
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Dec 18 21:59:41 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Dec 18 21:59:41 2014 +0200

--
 ambari-server/pom.xml   |   20 +-
 .../src/main/python/UpgradeHelper_HDP2.py   | 1245 --
 ambari-server/src/main/python/upgradeHelper.py  | 1183 +
 .../catalog/UpgradeCatalog_1.3_to_2.2.json  |  961 ++
 .../src/test/python/TestUpgradeHelper.py|   95 ++
 .../src/test/python/TestUpgradeScript_HDP2.py   |  646 -
 6 files changed, 2257 insertions(+), 1893 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c2b9a1a7/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 78012ba..f8f5487 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -500,7 +500,7 @@
   locationsrc/main/resources/scripts/location
 /source
 source
-  locationsrc/main/python/UpgradeHelper_HDP2.py/location
+  locationsrc/main/python/upgradeHelper.py/location
 /source
   /sources
 /mapping
@@ -544,6 +544,14 @@
   /sources
 /mapping
 mapping
+  
directory/var/lib/ambari-server/resources/upgrade/catalog/directory
+  sources
+source
+  locationsrc/main/resources/upgrade/catalog/location
+/source
+  /sources
+/mapping
+mapping
   
directory/var/lib/ambari-server/resources/stacks/${stack.distribution}/directory
   sources
 source
@@ -894,7 +902,7 @@
   /mapper
 /data
 data
-  srcsrc/main/python/UpgradeHelper_HDP2.py/src
+  srcsrc/main/python/upgradeHelper.py/src
   typefile/type
   mapper
 typeperm/type
@@ -919,6 +927,14 @@
   /mapper
 /data
 data
+  srcsrc/main/resources/upgrade/catalog/src
+  typedirectory/type
+  mapper
+typeperm/type
+
prefix/var/lib/ambari-server/resources/upgrade/catalog/prefix
+  /mapper
+/data
+data
   srctarget/classes/stacks/${stack.distribution}/src
   typedirectory/type
   mapper

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2b9a1a7/ambari-server/src/main/python/UpgradeHelper_HDP2.py
--
diff --git a/ambari-server/src/main/python/UpgradeHelper_HDP2.py 
b/ambari-server/src/main/python/UpgradeHelper_HDP2.py
deleted file mode 100644
index 396ec2b..000
--- a/ambari-server/src/main/python/UpgradeHelper_HDP2.py
+++ /dev/null
@@ -1,1245 +0,0 @@
-#!/usr/bin/env python
-
-'''
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-License); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an AS IS BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-'''
-
-import optparse
-from pprint import pprint
-import sys
-import datetime
-import os.path
-import logging
-import shutil
-import json
-import subprocess
-import time
-
-
-# action commands
-GET_MR_MAPPING_ACTION = save-mr-mapping
-DELETE_MR_ACTION = delete-mr
-ADD_YARN_MR2_ACTION = add-yarn-mr2
-MODIFY_CONFIG_ACTION = update-configs
-BACKUP_CONFIG_ACTION = backup-configs
-INSTALL_YARN_MR2_ACTION = install-yarn-mr2
-VALID_ACTIONS = ', '.join([GET_MR_MAPPING_ACTION, DELETE_MR_ACTION, 
ADD_YARN_MR2_ACTION, MODIFY_CONFIG_ACTION,
-  

[1/4] ambari git commit: AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 stack upgrade (dlysnichenko)

2014-12-18 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 68f9cb88e - c2b9a1a72


http://git-wip-us.apache.org/repos/asf/ambari/blob/c2b9a1a7/ambari-server/src/test/python/TestUpgradeHelper.py
--
diff --git a/ambari-server/src/test/python/TestUpgradeHelper.py 
b/ambari-server/src/test/python/TestUpgradeHelper.py
new file mode 100644
index 000..b5c6cb1
--- /dev/null
+++ b/ambari-server/src/test/python/TestUpgradeHelper.py
@@ -0,0 +1,95 @@
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+License); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an AS IS BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+'''
+
+
+from mock.mock import MagicMock, call
+from mock.mock import patch
+
+from unittest import TestCase
+import sys
+import unittest
+import upgradeHelper
+import StringIO
+import logging
+
+
+class TestUpgradeHelper(TestCase):
+  original_curl = None
+  out = None
+
+  def setUp(self):
+# replace original curl call to mock
+self.original_curl = upgradeHelper.curl
+upgradeHelper.curl = self.magic_curl
+
+# mock logging methods
+upgradeHelper.logging.getLogger = MagicMock()
+upgradeHelper.logging.FileHandler = MagicMock()
+
+self.out = StringIO.StringIO()
+sys.stdout = self.out
+
+  def magic_curl(self, *args, **kwargs):
+def ret_object():
+  return 
+
+def communicate():
+  return {}, 
+
+ret_object.returncode = 0
+ret_object.communicate = communicate
+
+with patch(upgradeHelper.subprocess) as subprocess:
+  subprocess.Popen.return_value = ret_object
+  self.original_curl(*args, **kwargs)
+
+  def tearDown(self):
+sys.stdout = sys.__stdout__
+
+  @patch(optparse.OptionParser)
+  @patch(upgradeHelper.modify_configs)
+  @patch(upgradeHelper.backup_file)
+  def test_ParseOptions(self, backup_file_mock, modify_action_mock, 
option_parser_mock):
+class options(object):
+  user = test_user
+  hostname = 127.0.0.1
+  clustername = test1
+  password = test_password
+  upgrade_json = catalog_file
+  from_stack = 0.0
+  to_stack = 1.3
+  logfile = test.log
+  warnings = []
+  printonly = False
+
+args = [update-configs]
+modify_action_mock.return_value = MagicMock()
+backup_file_mock.return_value = MagicMock()
+test_mock = MagicMock()
+test_mock.parse_args = lambda: (options, args)
+option_parser_mock.return_value = test_mock
+
+upgradeHelper.main()
+self.assertEqual(backup_file_mock.call_count, 1)
+self.assertEqual(modify_action_mock.call_count, 1)
+self.assertEqual({user: options.user, pass: options.password}, 
upgradeHelper.Options.TOKENS)
+self.assertEqual(options.clustername, upgradeHelper.Options.CLUSTER_NAME)
+
+
+if __name__ == __main__:
+  unittest.main()

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2b9a1a7/ambari-server/src/test/python/TestUpgradeScript_HDP2.py
--
diff --git a/ambari-server/src/test/python/TestUpgradeScript_HDP2.py 
b/ambari-server/src/test/python/TestUpgradeScript_HDP2.py
deleted file mode 100644
index 36ce54c..000
--- a/ambari-server/src/test/python/TestUpgradeScript_HDP2.py
+++ /dev/null
@@ -1,646 +0,0 @@
-'''
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-License); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an AS IS BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-'''
-import subprocess
-from mock.mock import MagicMock, call, patch
-from unittest import TestCase
-from mock.mock import create_autospec
-import sys
-import unittest
-import UpgradeHelper_HDP2
-import StringIO
-import logging
-
-
-class TestUpgradeHDP2Script(TestCase):
-  def setUp(self):
-UpgradeHelper_HDP2.logger = 

[2/4] ambari git commit: AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 stack upgrade (dlysnichenko)

2014-12-18 Thread dmitriusan
http://git-wip-us.apache.org/repos/asf/ambari/blob/c2b9a1a7/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
--
diff --git 
a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
 
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
new file mode 100644
index 000..5ee2816
--- /dev/null
+++ 
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
@@ -0,0 +1,961 @@
+{
+  version: 1.0,
+  stacks: [
+{
+  name: HDP,
+  old-version: 1.3,
+  target-version: 2.2,
+  options: {
+config-types: {
+  hdfs-site: {
+merged-copy: yes
+  },
+  core-site: {
+merged-copy: yes
+  },
+  hbase-site: {
+merged-copy: yes
+  },
+  hbase-env: {
+merged-copy: yes
+  },
+  oozie-env: {
+merged-copy: yes
+  },
+  hive-site: {
+merged-copy: yes
+  },
+  mapred-site: {
+merged-copy: yes
+  },
+  mapred-env: {
+merged-copy: yes
+  },
+  cluster-env : {
+merged-copy: yes
+  },
+  sqoop-env: {
+merged-copy: yes
+  },
+  pig-env: {
+merged-copy: yes
+  },
+  pig-properties: {
+merged-copy: yes
+  },
+  webhcat-site: {
+merged-copy: yes
+  },
+  zookeeper-env: {
+merged-copy: yes
+  },
+  hadoop-env: {
+merged-copy: yes
+  },
+  hadoop-policy: {
+merged-copy: yes
+  },
+  hbase-log4j: {
+merged-copy: yes
+  },
+  hdfs-log4j: {
+merged-copy: yes
+  },
+  hive-env: {
+merged-copy: yes
+  },
+  hive-exec-log4j: {
+merged-copy: yes
+  },
+  hive-log4j: {
+merged-copy: yes
+  },
+  oozie-site: {
+merged-copy: yes
+  }
+}
+  },
+  properties: {
+oozie-site: {
+  oozie.service.ProxyUserService.proxyuser.falcon.hosts: *,
+  oozie.service.coord.check.maximum.frequency: false,
+  oozie.service.SchemaService.wf.ext.schemas: 
shell-action-0.1.xsd,shell-action-0.2.xsd,shell-action-0.3.xsd,email-action-0.1.xsd,email-action-0.2.xsd,hive-action-0.2.xsd,hive-action-0.3.xsd,hive-action-0.4.xsd,hive-action-0.5.xsd,sqoop-action-0.2.xsd,sqoop-action-0.3.xsd,sqoop-action-0.4.xsd,ssh-action-0.1.xsd,ssh-action-0.2.xsd,distcp-action-0.1.xsd,distcp-action-0.2.xsd,oozie-sla-0.1.xsd,oozie-sla-0.2.xsd,
+  oozie.service.HadoopAccessorService.kerberos.enabled: false,
+  oozie.service.coord.push.check.requeue.interval: 3,
+  oozie.credentials.credentialclasses: 
hcat=org.apache.oozie.action.hadoop.HCatCredentials,
+  oozie.authentication.kerberos.name.rules: \n  
RULE:[2:$1@$0]([jt]t@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-MAPREDUSER/\n  
RULE:[2:$1@$0]([nd]n@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HDFSUSER/\n  
RULE:[2:$1@$0](hm@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n  
RULE:[2:$1@$0](rs@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n  DEFAULT,
+  oozie.authentication.simple.anonymous.allowed: true,
+  oozie.service.AuthorizationService.security.enabled: true,
+  oozie.services.ext: 
org.apache.oozie.service.JMSAccessorService,org.apache.oozie.service.PartitionDependencyManagerService,org.apache.oozie.service.HCatAccessorService,
+  oozie.services: \n  
org.apache.oozie.service.SchedulerService,\n  
org.apache.oozie.service.InstrumentationService,\n  
org.apache.oozie.service.MemoryLocksService,\n  
org.apache.oozie.service.UUIDService,\n  
org.apache.oozie.service.ELService,\n  
org.apache.oozie.service.AuthorizationService,\n  
org.apache.oozie.service.UserGroupInformationService,\n  
org.apache.oozie.service.HadoopAccessorService,\n  
org.apache.oozie.service.JobsConcurrencyService,\n  
org.apache.oozie.service.URIHandlerService,\n  
org.apache.oozie.service.DagXLogInfoService,\n  
org.apache.oozie.service.SchemaService,\n  
org.apache.oozie.service.LiteWorkflowAppService,\n  
org.apache.oozie.service.JPAService,\n  
org.apache.oozie.service.StoreService,\n  
org.apache.oozie.service.CoordinatorStoreService,\n  
org.apache.oozie.service.SLAStoreService,\n  
org.apache.oozie.service.DBLiteWorkflowStoreService,\n  
org.apache.oozie.service.C
 allbackService,\n  org.apache.oozie.service.ShareLibService,\n  
org.apache.oozie.service.CallableQueueService,\n  
org.apache.oozie.service.ActionService,\n  

ambari git commit: AMBARI-8716. RU: The default repo version / stack version do not have any OS / base repo URL information (dlysnichenko)

2014-12-19 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk f13beb866 - 91700e782


AMBARI-8716. RU: The default repo version / stack version do not have any OS / 
base repo URL information (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 91700e7828e1564809c291a3cd4ad16308c8a6f6
Parents: f13beb8
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Dec 19 13:02:44 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Dec 19 13:02:44 2014 +0200

--
 .../AmbariManagementControllerImpl.java |  9 +++--
 .../RepositoryVersionResourceProvider.java  | 38 ++--
 .../orm/entities/RepositoryVersionEntity.java   |  9 -
 .../server/upgrade/UpgradeCatalog200.java   |  2 +-
 .../Ambari-DDL-Postgres-EMBEDDED-CREATE.sql |  2 +-
 .../RepositoryVersionResourceProviderTest.java  | 17 +
 6 files changed, 69 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/91700e78/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 a907276..19ee6d9 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
@@ -75,6 +75,7 @@ import org.apache.ambari.server.actionmanager.StageFactory;
 import org.apache.ambari.server.agent.ExecutionCommand;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.configuration.Configuration;
+import 
org.apache.ambari.server.controller.internal.RepositoryVersionResourceProvider;
 import org.apache.ambari.server.controller.internal.RequestOperationLevel;
 import org.apache.ambari.server.controller.internal.RequestStageContainer;
 import org.apache.ambari.server.controller.internal.URLStreamProvider;
@@ -144,6 +145,7 @@ import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.Singleton;
 import com.google.inject.persist.Transactional;
+
 import org.apache.ambari.server.controller.internal.RequestResourceFilter;
 import org.apache.ambari.server.state.HostComponentAdminState;
 
@@ -361,13 +363,14 @@ public class AmbariManagementControllerImpl implements 
AmbariManagementControlle
   StackId newStackId = new StackId(request.getStackVersion());
   c.setDesiredStackVersion(newStackId);
   clusters.setCurrentStackVersion(request.getClusterName(), newStackId);
-  
+
   try {
 // Because Ambari may eventually support multiple clusters, it may be 
possible that a previously installed cluster
 // already inserted the Repository Version for this stack and version.
-RepositoryVersionEntity existingRepositoryVersion = 
repositoryVersionDAO.findByStackAndVersion(newStackId.getStackId(),  
newStackId.getStackVersion());
+RepositoryVersionEntity existingRepositoryVersion = 
repositoryVersionDAO.findByStackAndVersion(newStackId.getStackId(), 
newStackId.getStackVersion());
 if (existingRepositoryVersion == null) {
-  repositoryVersionDAO.create(newStackId.getStackId(), 
newStackId.getStackVersion(), newStackId.getStackId(), , );
+  repositoryVersionDAO.create(newStackId.getStackId(), 
newStackId.getStackVersion(), newStackId.getStackId(),
+  , 
RepositoryVersionResourceProvider.serializeOperatingSystems(stackInfo.getRepositories()));
 }
 c.createClusterVersion(stackId.getStackId(), 
stackId.getStackVersion(), getAuthName(), RepositoryVersionState.CURRENT);
   } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/91700e78/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
index 4cf844d..58817a8 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/RepositoryVersionResourceProvider.java
+++ 

[1/4] ambari git commit: AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 stack upgrade (dlysnichenko)

2014-12-19 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 8b0e4f878 - abf405522


http://git-wip-us.apache.org/repos/asf/ambari/blob/abf40552/ambari-server/src/test/python/TestUpgradeHelper.py
--
diff --git a/ambari-server/src/test/python/TestUpgradeHelper.py 
b/ambari-server/src/test/python/TestUpgradeHelper.py
new file mode 100644
index 000..2f47620
--- /dev/null
+++ b/ambari-server/src/test/python/TestUpgradeHelper.py
@@ -0,0 +1,97 @@
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+License); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an AS IS BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+'''
+
+
+from mock.mock import MagicMock, call
+from mock.mock import patch
+
+from unittest import TestCase
+import sys
+import unittest
+import upgradeHelper
+import StringIO
+import logging
+
+
+class TestUpgradeHelper(TestCase):
+  original_curl = None
+  out = None
+
+  def setUp(self):
+# replace original curl call to mock
+self.original_curl = upgradeHelper.curl
+upgradeHelper.curl = self.magic_curl
+
+# mock logging methods
+upgradeHelper.logging.getLogger = MagicMock()
+upgradeHelper.logging.FileHandler = MagicMock()
+
+self.out = StringIO.StringIO()
+sys.stdout = self.out
+
+  def magic_curl(self, *args, **kwargs):
+def ret_object():
+  return 
+
+def communicate():
+  return {}, 
+
+ret_object.returncode = 0
+ret_object.communicate = communicate
+
+with patch(upgradeHelper.subprocess) as subprocess:
+  subprocess.Popen.return_value = ret_object
+  self.original_curl(*args, **kwargs)
+
+  def tearDown(self):
+sys.stdout = sys.__stdout__
+
+  @patch(optparse.OptionParser)
+  @patch(upgradeHelper.modify_configs)
+  @patch(upgradeHelper.backup_file)
+  @patch(__builtin__.open)
+  def test_ParseOptions(self, open_mock, backup_file_mock, modify_action_mock, 
option_parser_mock):
+class options(object):
+  user = test_user
+  hostname = 127.0.0.1
+  clustername = test1
+  password = test_password
+  upgrade_json = catalog_file
+  from_stack = 0.0
+  to_stack = 1.3
+  logfile = test.log
+  report = report.txt
+  warnings = []
+  printonly = False
+
+args = [update-configs]
+modify_action_mock.return_value = MagicMock()
+backup_file_mock.return_value = MagicMock()
+test_mock = MagicMock()
+test_mock.parse_args = lambda: (options, args)
+option_parser_mock.return_value = test_mock
+
+upgradeHelper.main()
+self.assertEqual(backup_file_mock.call_count, 0)
+self.assertEqual(modify_action_mock.call_count, 1)
+self.assertEqual({user: options.user, pass: options.password}, 
upgradeHelper.Options.API_TOKENS)
+self.assertEqual(options.clustername, upgradeHelper.Options.CLUSTER_NAME)
+
+
+if __name__ == __main__:
+  unittest.main()

http://git-wip-us.apache.org/repos/asf/ambari/blob/abf40552/ambari-server/src/test/python/TestUpgradeScript_HDP2.py
--
diff --git a/ambari-server/src/test/python/TestUpgradeScript_HDP2.py 
b/ambari-server/src/test/python/TestUpgradeScript_HDP2.py
deleted file mode 100644
index 36ce54c..000
--- a/ambari-server/src/test/python/TestUpgradeScript_HDP2.py
+++ /dev/null
@@ -1,646 +0,0 @@
-'''
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-License); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an AS IS BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-'''
-import subprocess
-from mock.mock import MagicMock, call, patch
-from unittest import TestCase
-from mock.mock import create_autospec
-import sys
-import unittest
-import UpgradeHelper_HDP2
-import StringIO
-import logging
-
-
-class 

[2/4] ambari git commit: AMBARI-8714. Refactor UpgradeHelper_HDP2.py script to be compliant with 2.0/2.1 stack upgrade (dlysnichenko)

2014-12-19 Thread dmitriusan
http://git-wip-us.apache.org/repos/asf/ambari/blob/abf40552/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
--
diff --git 
a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
 
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
new file mode 100644
index 000..5ee2816
--- /dev/null
+++ 
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_1.3_to_2.2.json
@@ -0,0 +1,961 @@
+{
+  version: 1.0,
+  stacks: [
+{
+  name: HDP,
+  old-version: 1.3,
+  target-version: 2.2,
+  options: {
+config-types: {
+  hdfs-site: {
+merged-copy: yes
+  },
+  core-site: {
+merged-copy: yes
+  },
+  hbase-site: {
+merged-copy: yes
+  },
+  hbase-env: {
+merged-copy: yes
+  },
+  oozie-env: {
+merged-copy: yes
+  },
+  hive-site: {
+merged-copy: yes
+  },
+  mapred-site: {
+merged-copy: yes
+  },
+  mapred-env: {
+merged-copy: yes
+  },
+  cluster-env : {
+merged-copy: yes
+  },
+  sqoop-env: {
+merged-copy: yes
+  },
+  pig-env: {
+merged-copy: yes
+  },
+  pig-properties: {
+merged-copy: yes
+  },
+  webhcat-site: {
+merged-copy: yes
+  },
+  zookeeper-env: {
+merged-copy: yes
+  },
+  hadoop-env: {
+merged-copy: yes
+  },
+  hadoop-policy: {
+merged-copy: yes
+  },
+  hbase-log4j: {
+merged-copy: yes
+  },
+  hdfs-log4j: {
+merged-copy: yes
+  },
+  hive-env: {
+merged-copy: yes
+  },
+  hive-exec-log4j: {
+merged-copy: yes
+  },
+  hive-log4j: {
+merged-copy: yes
+  },
+  oozie-site: {
+merged-copy: yes
+  }
+}
+  },
+  properties: {
+oozie-site: {
+  oozie.service.ProxyUserService.proxyuser.falcon.hosts: *,
+  oozie.service.coord.check.maximum.frequency: false,
+  oozie.service.SchemaService.wf.ext.schemas: 
shell-action-0.1.xsd,shell-action-0.2.xsd,shell-action-0.3.xsd,email-action-0.1.xsd,email-action-0.2.xsd,hive-action-0.2.xsd,hive-action-0.3.xsd,hive-action-0.4.xsd,hive-action-0.5.xsd,sqoop-action-0.2.xsd,sqoop-action-0.3.xsd,sqoop-action-0.4.xsd,ssh-action-0.1.xsd,ssh-action-0.2.xsd,distcp-action-0.1.xsd,distcp-action-0.2.xsd,oozie-sla-0.1.xsd,oozie-sla-0.2.xsd,
+  oozie.service.HadoopAccessorService.kerberos.enabled: false,
+  oozie.service.coord.push.check.requeue.interval: 3,
+  oozie.credentials.credentialclasses: 
hcat=org.apache.oozie.action.hadoop.HCatCredentials,
+  oozie.authentication.kerberos.name.rules: \n  
RULE:[2:$1@$0]([jt]t@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-MAPREDUSER/\n  
RULE:[2:$1@$0]([nd]n@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HDFSUSER/\n  
RULE:[2:$1@$0](hm@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n  
RULE:[2:$1@$0](rs@.*TODO-KERBEROS-DOMAIN)s/.*/TODO-HBASE-USER/\n  DEFAULT,
+  oozie.authentication.simple.anonymous.allowed: true,
+  oozie.service.AuthorizationService.security.enabled: true,
+  oozie.services.ext: 
org.apache.oozie.service.JMSAccessorService,org.apache.oozie.service.PartitionDependencyManagerService,org.apache.oozie.service.HCatAccessorService,
+  oozie.services: \n  
org.apache.oozie.service.SchedulerService,\n  
org.apache.oozie.service.InstrumentationService,\n  
org.apache.oozie.service.MemoryLocksService,\n  
org.apache.oozie.service.UUIDService,\n  
org.apache.oozie.service.ELService,\n  
org.apache.oozie.service.AuthorizationService,\n  
org.apache.oozie.service.UserGroupInformationService,\n  
org.apache.oozie.service.HadoopAccessorService,\n  
org.apache.oozie.service.JobsConcurrencyService,\n  
org.apache.oozie.service.URIHandlerService,\n  
org.apache.oozie.service.DagXLogInfoService,\n  
org.apache.oozie.service.SchemaService,\n  
org.apache.oozie.service.LiteWorkflowAppService,\n  
org.apache.oozie.service.JPAService,\n  
org.apache.oozie.service.StoreService,\n  
org.apache.oozie.service.CoordinatorStoreService,\n  
org.apache.oozie.service.SLAStoreService,\n  
org.apache.oozie.service.DBLiteWorkflowStoreService,\n  
org.apache.oozie.service.C
 allbackService,\n  org.apache.oozie.service.ShareLibService,\n  
org.apache.oozie.service.CallableQueueService,\n  
org.apache.oozie.service.ActionService,\n  

[1/2] git commit: AMBARI-5182. Retrieve registered host from API throws exception (dlysnichenko)

2014-03-21 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-1.5.0 075cec562 - 982c6075d
  refs/heads/trunk 8d58c3262 - a3410253c


AMBARI-5182. Retrieve registered host from API throws exception (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: a3410253caaec3527792a71f02bdc5e5cecef29a
Parents: 8d58c32
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Mar 21 22:36:29 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Mar 21 22:36:29 2014 +0200

--
 .../nagios/NagiosPropertyProvider.java  |  8 +--
 .../nagios/NagiosPropertyProviderTest.java  | 23 
 2 files changed, 29 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a3410253/ambari-server/src/main/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProvider.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProvider.java
index f80d4a6..4dc8f16 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProvider.java
@@ -164,8 +164,12 @@ public class NagiosPropertyProvider extends BaseProvider 
implements PropertyProv
   
   if (null == matchValue)
 continue;
-  
-  String clusterName = 
res.getPropertyValue(clusterNameProperty).toString();
+
+  Object clusterPropertyValue = res.getPropertyValue(clusterNameProperty);
+  if (null == clusterPropertyValue)
+continue;
+
+  String clusterName = clusterPropertyValue.toString();
   if (null == clusterName)
 continue;
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/a3410253/ambari-server/src/test/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProviderTest.java
index 9c6977d..9f3ff85 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProviderTest.java
@@ -120,6 +120,29 @@ public class NagiosPropertyProviderTest {
 
 Assert.assertFalse(Expected no alerts, values.containsKey(alerts));
   }
+
+
+  @Test
+  public void testClusterDoesNotExistNPE() throws Exception {
+TestStreamProvider streamProvider = new 
TestStreamProvider(nagios_alerts.txt);
+
+NagiosPropertyProvider npp = new 
NagiosPropertyProvider(Resource.Type.Service,
+streamProvider,
+ServiceInfo/cluster_name,
+ServiceInfo/service_name);
+
+Resource resource = new ResourceImpl(Resource.Type.Service);
+resource.setProperty(ServiceInfo/cluster_name, null);
+resource.setProperty(ServiceInfo/service_name, HBASE);
+
+// request with an empty set should get all supported properties
+Request request = 
PropertyHelper.getReadRequest(Collections.StringemptySet(),
+new HashMapString, TemporalInfo());
+
+SetResource set = npp.populateResources(Collections.singleton(resource), 
request, null);
+Assert.assertEquals(1, set.size());
+
+  }
   
   @Test
   public void testNoNagiosServerCompoonent() throws Exception {



[2/2] git commit: AMBARI-5187. Ganglia rrdcached base directory has not applied in fact (dlysnichenko)

2014-03-24 Thread dmitriusan
AMBARI-5187. Ganglia rrdcached base directory has not applied in fact 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 20ca5e57088e9228add876e752b0367edaff080a
Parents: d94b1d0
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Mar 24 17:47:47 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Mar 24 17:49:21 2014 +0200

--
 .../services/GANGLIA/package/scripts/ganglia_server.py  | 1 +
 .../test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py | 9 -
 2 files changed, 9 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/20ca5e57/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py
index a027f30..258946b 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/scripts/ganglia_server.py
@@ -37,6 +37,7 @@ class GangliaServer(Script):
   def start(self, env):
 import params
 env.set_params(params)
+server_files()
 ganglia_server_service.server(start)
 
   def stop(self, env):

http://git-wip-us.apache.org/repos/asf/ambari/blob/20ca5e57/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py 
b/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py
index 95c9fea..ffc15e2 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/GANGLIA/test_ganglia_server.py
@@ -199,6 +199,13 @@ class TestGangliaServer(RMFTestCase):
command=start,
config_file=default.json
 )
+self.assertResourceCalled('Directory', '/srv/www/cgi-bin',
+  recursive = True,
+  )
+self.assertResourceCalled('File', '/srv/www/cgi-bin/rrd.py',
+  content = StaticFile('rrd.py'),
+  mode = 0755,
+  )
 self.assertResourceCalled('Execute', 'service hdp-gmetad start  
/tmp/gmetad.log  21 ; /bin/ps auwx | /bin/grep [g]metad   /tmp/gmetad.log  
21',
   path = 
['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
   )
@@ -389,4 +396,4 @@ class TestGangliaServer(RMFTestCase):
 
 self.assertResourceCalled('Execute', 'chkconfig gmetad off',
   path = 
['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],)
-self.assertNoMoreResources()
\ No newline at end of file
+self.assertNoMoreResources()



git commit: AMBARI-5188. Component version numbers do not seem accurate (dlysnichenko)

2014-03-24 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 20ca5e570 - 509e02bc0


AMBARI-5188. Component version numbers do not seem accurate (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 509e02bc07ce2891bfcb473de71ebc1107a0720e
Parents: 20ca5e5
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Mar 24 18:20:24 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Mar 24 18:20:24 2014 +0200

--
 .../src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml | 2 +-
 .../src/main/resources/stacks/HDP/2.1/services/HBASE/metainfo.xml  | 2 +-
 .../src/main/resources/stacks/HDP/2.1/services/HIVE/metainfo.xml   | 2 +-
 .../src/main/resources/stacks/HDP/2.1/services/OOZIE/metainfo.xml  | 2 +-
 .../src/main/resources/stacks/HDP/2.1/services/PIG/metainfo.xml| 2 +-
 .../src/main/resources/stacks/HDP/2.1/services/SQOOP/metainfo.xml  | 2 +-
 .../src/main/resources/stacks/HDP/2.1/services/STORM/metainfo.xml  | 2 +-
 .../main/resources/stacks/HDP/2.1/services/WEBHCAT/metainfo.xml| 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/509e02bc/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
index c3bc137..5d1a1c4 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/metainfo.xml
@@ -21,7 +21,7 @@
 service
   nameFALCON/name
   commentData management and processing platform/comment
-  version0.4.0.2.1.1/version
+  version0.4.0.2.1/version
   components
 component
   nameFALCON_CLIENT/name

http://git-wip-us.apache.org/repos/asf/ambari/blob/509e02bc/ambari-server/src/main/resources/stacks/HDP/2.1/services/HBASE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/HBASE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/HBASE/metainfo.xml
index 6f54a15..ef03b43 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/HBASE/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/HBASE/metainfo.xml
@@ -23,7 +23,7 @@
   commentNon-relational distributed database and centralized service for 
configuration management amp;
 synchronization
   /comment
-  version0.96.0.2.1/version
+  version0.98.0.2.1/version
 /service
   /services
 /metainfo

http://git-wip-us.apache.org/repos/asf/ambari/blob/509e02bc/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/metainfo.xml
index e43fd55..1a60125 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/services/HIVE/metainfo.xml
@@ -21,7 +21,7 @@
 service
   nameHIVE/name
   commentData warehouse system for ad-hoc queries amp; analysis of 
large datasets and table amp; storage management service/comment
-  version0.12.0.2.1/version
+  version0.13.0.2.1/version
 
   configuration-dependencies
 config-typehive-site/config-type

http://git-wip-us.apache.org/repos/asf/ambari/blob/509e02bc/ambari-server/src/main/resources/stacks/HDP/2.1/services/OOZIE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/OOZIE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/OOZIE/metainfo.xml
index 3419663..e8c31f9 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/OOZIE/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/OOZIE/metainfo.xml
@@ -22,7 +22,7 @@
   nameOOZIE/name
   commentSystem for workflow coordination and execution of Apache Hadoop 
jobs.  This also includes the installation of the optional Oozie Web Console 
which relies on and will install the lt;a target=_blank 
href=http://www.sencha.com/products/extjs/license/gt;ExtJSlt;/agt; Library.
   /comment

git commit: AMBARI-5204. Host clean up should rely on host check to tell it what processes to kill (dlysnichenko)

2014-03-25 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 6625ae5dd - e3f47c061


AMBARI-5204. Host clean up should rely on host check to tell it what processes 
to kill (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: e3f47c061da47ef805b08df78410885c20d7ae5f
Parents: 6625ae5
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Mar 25 18:32:49 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Mar 25 18:33:22 2014 +0200

--
 .../src/main/python/ambari_agent/HostCleanup.py | 24 ++-
 .../test/python/ambari_agent/TestHostCleanup.py | 67 +---
 2 files changed, 36 insertions(+), 55 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e3f47c06/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py 
b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
index 181b67b..da16dec 100644
--- a/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
+++ b/ambari-agent/src/main/python/ambari_agent/HostCleanup.py
@@ -167,7 +167,11 @@ class HostCleanup:
 propertyMap[PACKAGE_SECTION] = config.get(PACKAGE_SECTION, 
PACKAGE_KEY).split(',')
 except:
   logger.warn(Cannot read package list:  + str(sys.exc_info()[0]))
-
+try:
+  if config.has_option(PROCESS_SECTION, PROCESS_KEY):
+propertyMap[PROCESS_SECTION] = config.get(PROCESS_SECTION, 
PROCESS_KEY).split(',')
+except:
+logger.warn(Cannot read process list:  + str(sys.exc_info()[0]))
 try:
   if config.has_option(USER_SECTION, USER_KEY):
 propertyMap[USER_SECTION] = config.get(USER_SECTION, 
USER_KEY).split(',')
@@ -192,19 +196,6 @@ class HostCleanup:
 except:
   logger.warn(Cannot read dir list:  + str(sys.exc_info()[0]))
 
-process_items = []
-try:
-  pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]
-  for pid in pids:
-cmd = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()
-cmd = cmd.replace('\0', ' ')
-if not 'AmbariServer' in cmd and not 'HostCleanup' in cmd:
-  if 'java' in cmd and JAVA_HOME in cmd:
-process_items.append(int(pid))
-except:
-  pass
-propertyMap[PROCESS_SECTION] = process_items
-
 try:
   alt_map = {}
   if config.has_option(ALT_SECTION, ALT_KEYS[0]):
@@ -501,8 +492,6 @@ def main():
   parser.add_option(-s, --silent,
 action=store_true, dest=silent, default=False,
 help=Silently accepts default prompt values)
-  parser.add_option('-j', '--java-home', default=/usr/jdk64/jdk1.6.0_31, 
dest=java_home,
-help=Use specified java_home.)
 
 
   (options, args) = parser.parse_args()
@@ -515,9 +504,6 @@ def main():
   handler.setFormatter(formatter)
   logger.addHandler(handler)
 
-  # set java_home
-  global JAVA_HOME
-  JAVA_HOME = options.java_home
 
   # set verbose
   if options.verbose:

http://git-wip-us.apache.org/repos/asf/ambari/blob/e3f47c06/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py 
b/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py
index 568711b..b624212 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestHostCleanup.py
@@ -44,27 +44,7 @@ ALT_KEYS = [symlink_list, target_list]
 ALT_ERASE_CMD = alternatives --remove {0} {1}
 USER_HOMEDIR_SECTION = usr_homedir
 
-class TestHostCleanup(TestCase):
-
-  def setUp(self):
-HostCleanup.logger = MagicMock()
-self.hostcleanup = HostCleanup.HostCleanup()
-# disable stdout
-out = StringIO.StringIO()
-sys.stdout = out
-
-
-  def tearDown(self):
-# enable stdout
-sys.stdout = sys.__stdout__
-
-  @patch(os.listdir, create=True, autospec=True)
-  def test_read_host_check_file_with_content(self, os_listdir_mock):
-out = StringIO.StringIO()
-sys.stdout = out
-tmpfile = tempfile.mktemp()
-f = open(tmpfile,'w')
-fileContent = [processes]
+hostcheck_result_fileContent = [processes]
 proc_list = 323,434
 
 [users]
@@ -85,7 +65,28 @@ pkg_list = 
sqoop.noarch,hadoop-libhdfs.x86_64,rrdtool.x86_64,ganglia-gmond.x86_6
 
 [metadata]
 created = 2013-07-02 20:39:22.162757
-f.write(fileContent)
+
+class TestHostCleanup(TestCase):
+
+  def setUp(self):
+HostCleanup.logger = 

[2/2] git commit: AMBARI-5228. gmond processes for master components are not starting after upgrade (dlysnichenko)

2014-03-27 Thread dmitriusan
AMBARI-5228. gmond processes for master components are not starting after 
upgrade (dlysnichenko)


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

Branch: refs/heads/branch-1.5.0
Commit: 46d802ca0fca14420df282294f073ed882d8c009
Parents: 9064d71
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Mar 27 19:44:57 2014 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Mar 27 19:44:57 2014 +0200

--
 .../stacks/HDP/1.3.2/role_command_order.json| 100 ++
 .../GANGLIA/package/scripts/ganglia_server.py   |   2 +-
 .../stacks/HDP/1.3.3/role_command_order.json| 100 ++
 .../GANGLIA/package/scripts/ganglia_server.py   |   2 +-
 .../stacks/1.3.2/GANGLIA/test_ganglia_server.py | 354 ++-
 .../stacks/2.0.6/GANGLIA/test_ganglia_server.py | 335 +-
 6 files changed, 547 insertions(+), 346 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/46d802ca/ambari-server/src/main/resources/stacks/HDP/1.3.2/role_command_order.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/role_command_order.json 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/role_command_order.json
new file mode 100644
index 000..84610ca
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/role_command_order.json
@@ -0,0 +1,100 @@
+{
+  _comment : Record format:,
+  _comment : blockedRole-blockedCommand: [blockerRole1-blockerCommand1, 
blockerRole2-blockerCommand2, ...],
+  general_deps : {
+_comment : dependencies for all cases,
+NAGIOS_SERVER-INSTALL : [HIVE_CLIENT-INSTALL, HCAT-INSTALL,
+MAPREDUCE_CLIENT-INSTALL, OOZIE_CLIENT-INSTALL],
+HBASE_MASTER-START: [ZOOKEEPER_SERVER-START],
+HBASE_REGIONSERVER-START: [HBASE_MASTER-START],
+OOZIE_SERVER-START: [JOBTRACKER-START, TASKTRACKER-START],
+WEBHCAT_SERVER-START: [TASKTRACKER-START, HIVE_SERVER-START],
+HIVE_METASTORE-START: [MYSQL_SERVER-START],
+HIVE_SERVER-START: [TASKTRACKER-START, MYSQL_SERVER-START],
+HUE_SERVER-START: [HIVE_SERVER-START, HCAT-START, 
OOZIE_SERVER-START],
+FLUME_SERVER-START: [OOZIE_SERVER-START],
+NAGIOS_SERVER-START: [HBASE_MASTER-START, HBASE_REGIONSERVER-START,
+GANGLIA_SERVER-START, GANGLIA_MONITOR-START, HCAT-START,
+HIVE_SERVER-START, HIVE_METASTORE-START, HUE_SERVER-START,
+JOBTRACKER-START, TASKTRACKER-START, ZOOKEEPER_SERVER-START,
+MYSQL_SERVER-START, OOZIE_SERVER-START, PIG-START, SQOOP-START,
+WEBHCAT_SERVER-START, FLUME_SERVER-START],
+MAPREDUCE_SERVICE_CHECK-SERVICE_CHECK: [JOBTRACKER-START, 
TASKTRACKER-START],
+OOZIE_SERVICE_CHECK-SERVICE_CHECK: [OOZIE_SERVER-START],
+WEBHCAT_SERVICE_CHECK-SERVICE_CHECK: [WEBHCAT_SERVER-START],
+HBASE_SERVICE_CHECK-SERVICE_CHECK: [HBASE_MASTER-START, 
HBASE_REGIONSERVER-START],
+HIVE_SERVICE_CHECK-SERVICE_CHECK: [HIVE_SERVER-START, 
HIVE_METASTORE-START],
+HCAT_SERVICE_CHECK-SERVICE_CHECK: [HIVE_SERVER-START],
+PIG_SERVICE_CHECK-SERVICE_CHECK: [JOBTRACKER-START, 
TASKTRACKER-START],
+SQOOP_SERVICE_CHECK-SERVICE_CHECK: [JOBTRACKER-START, 
TASKTRACKER-START],
+ZOOKEEPER_SERVICE_CHECK-SERVICE_CHECK: [ZOOKEEPER_SERVER-START],
+ZOOKEEPER_QUORUM_SERVICE_CHECK-SERVICE_CHECK: [ZOOKEEPER_SERVER-START],
+ZOOKEEPER_SERVER-STOP : [HBASE_MASTER-STOP, HBASE_REGIONSERVER-STOP],
+HBASE_MASTER-STOP: [HBASE_REGIONSERVER-STOP],
+TASKTRACKER-UPGRADE: [JOBTRACKER-UPGRADE],
+MAPREDUCE_CLIENT-UPGRADE: [TASKTRACKER-UPGRADE, JOBTRACKER-UPGRADE],
+ZOOKEEPER_SERVER-UPGRADE: [MAPREDUCE_CLIENT-UPGRADE],
+ZOOKEEPER_CLIENT-UPGRADE: [ZOOKEEPER_SERVER-UPGRADE],
+HBASE_MASTER-UPGRADE: [ZOOKEEPER_CLIENT-UPGRADE],
+HBASE_REGIONSERVER-UPGRADE: [HBASE_MASTER-UPGRADE],
+HBASE_CLIENT-UPGRADE: [HBASE_REGIONSERVER-UPGRADE],
+HIVE_SERVER-UPGRADE : [HBASE_CLIENT-UPGRADE],
+HIVE_METASTORE-UPGRADE : [HIVE_SERVER-UPGRADE],
+MYSQL_SERVER-UPGRADE: [HIVE_METASTORE-UPGRADE],
+HIVE_CLIENT-UPGRADE: [MYSQL_SERVER-UPGRADE],
+HCAT-UPGRADE: [HIVE_CLIENT-UPGRADE],
+OOZIE_SERVER-UPGRADE : [HCAT-UPGRADE],
+OOZIE_CLIENT-UPGRADE : [OOZIE_SERVER-UPGRADE],
+WEBHCAT_SERVER-UPGRADE : [OOZIE_CLIENT-UPGRADE],
+PIG-UPGRADE : [WEBHCAT_SERVER-UPGRADE],
+SQOOP-UPGRADE : [PIG-UPGRADE],
+NAGIOS_SERVER-UPGRADE : [SQOOP-UPGRADE],
+GANGLIA_SERVER-UPGRADE : [NAGIOS_SERVER-UPGRADE],
+GANGLIA_MONITOR-UPGRADE : [GANGLIA_SERVER-UPGRADE]
+  },
+  _comment : GLUSTERFS-specific dependencies,
+  optional_glusterfs: {
+

git commit: AMBARI-5282. supervisor.enable should be removed from Ambari's Storm Config section (dlysnichenko)

2014-03-31 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk b8f09dae6 - b1563db09


AMBARI-5282. supervisor.enable should be removed from Ambari's Storm Config 
section (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: b1563db098b3876ecb7f43f29eff04ee7a40ce00
Parents: b8f09da
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Mar 31 17:46:26 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Mar 31 17:47:23 2014 +0300

--
 .../2.1/services/STORM/configuration/storm-site.xml   |  7 ---
 .../data/configurations/cluster_level_configs.json|  1 -
 .../data/wizard/stack/hdp/version2.0.1/STORM.json | 14 +-
 ambari-web/app/data/HDP2/site_properties.js   |  8 
 4 files changed, 1 insertion(+), 29 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b1563db0/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/configuration/storm-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/configuration/storm-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/configuration/storm-site.xml
index a8e22bf..9fa9e74 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/configuration/storm-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/configuration/storm-site.xml
@@ -291,13 +291,6 @@
 descriptionHow often the supervisor sends a heartbeat to the 
master./description
   /property
   property
-namesupervisor.enable/name
-valuetrue/value
-descriptionWhether or not the supervisor should launch workers assigned 
to it. Defaults
-   to true -- and you should probably never change this value. This 
configuration
-   is used in the Storm unit tests./description
-  /property
-  property
 nameworker.childopts/name
 value-Xmx768m 
-javaagent:/usr/lib/storm/contrib/storm-jmxetric/lib/jmxetric-1.0.4.jar=host=,port=8650,wireformat31x=true,mode=multicast,config=/usr/lib/storm/contrib/storm-jmxetric/conf/jmxetric-conf.xml,process=Worker_%ID%_JVM/value
 descriptionThe jvm opts provided to workers launched by this supervisor. 
All \%ID%\ substrings are replaced with an identifier for this 
worker./description

http://git-wip-us.apache.org/repos/asf/ambari/blob/b1563db0/ambari-web/app/assets/data/configurations/cluster_level_configs.json
--
diff --git 
a/ambari-web/app/assets/data/configurations/cluster_level_configs.json 
b/ambari-web/app/assets/data/configurations/cluster_level_configs.json
index 1712a42..267c4f6 100644
--- a/ambari-web/app/assets/data/configurations/cluster_level_configs.json
+++ b/ambari-web/app/assets/data/configurations/cluster_level_configs.json
@@ -604,7 +604,6 @@
 storm.zookeeper.servers : ['localhost'],
 storm.zookeeper.session.timeout : 2,
 supervisor.childopts : -Xmx256m,
-supervisor.enable : true,
 supervisor.heartbeat.frequency.secs : 5,
 supervisor.monitor.frequency.secs : 3,
 supervisor.slots.ports : [6700, 6701, 6702, 6703],

http://git-wip-us.apache.org/repos/asf/ambari/blob/b1563db0/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/STORM.json
--
diff --git 
a/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/STORM.json 
b/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/STORM.json
index 5d1b134..58fd2a7 100644
--- a/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/STORM.json
+++ b/ambari-web/app/assets/data/wizard/stack/hdp/version2.0.1/STORM.json
@@ -530,18 +530,6 @@
   }
 },
 {
-  href : 
http://c6401.ambari.apache.org:8080/api/v1/stacks2/HDP/versions/2.0.8/stackServices/STORM/configurations/supervisor.enable;,
-  StackConfigurations : {
-property_description : ,
-property_name : supervisor.enable,
-property_value : true,
-service_name : STORM,
-stack_name : HDP,
-stack_version : 2.0.8,
-type : storm-site.xml
-  }
-},
-{
   href : 
http://c6401.ambari.apache.org:8080/api/v1/stacks2/HDP/versions/2.0.8/stackServices/STORM/configurations/supervisor.heartbeat.frequency.secs;,
   StackConfigurations : {
 property_description : How frequently the supervisor heartbeats to 
the cluster state (for nimbus),
@@ -1094,4 +1082,4 @@
   }
 }
   ]
-}
\ No newline at end of 

git commit: AMBARI-5287. Add RepoInfo Data for HDP Stack for 2.1 (Ubuntu) in the stack definition. (dlysnichenko)

2014-03-31 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk b56019031 - 15593


AMBARI-5287. Add RepoInfo Data for HDP Stack for 2.1 (Ubuntu) in the stack 
definition. (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 155939af573e3947e2d5e14fb796565cfd16
Parents: b560190
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Mar 31 18:32:53 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Mar 31 18:34:20 2014 +0300

--
 ambari-server/set-hdp-repo-url.sh | 4 
 .../src/main/resources/stacks/HDP/2.1/repos/repoinfo.xml  | 7 +++
 2 files changed, 11 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1559/ambari-server/set-hdp-repo-url.sh
--
diff --git a/ambari-server/set-hdp-repo-url.sh 
b/ambari-server/set-hdp-repo-url.sh
index e338014..e66d21e 100644
--- a/ambari-server/set-hdp-repo-url.sh
+++ b/ambari-server/set-hdp-repo-url.sh
@@ -30,6 +30,7 @@ then
   C6URL=$1
   C5URL=${C6URL/centos6/centos5}
   S11URL=${C6URL/centos6/suse11}
+  U12URL=${C6URL/centos6/ubuntu12}
 
   if [ $# != 2 ]
   then
@@ -49,4 +50,7 @@ then
 
   echo Setting suse11 stack url to '$S11URL'
   sed  s;REPLACE_WITH_SUSE11_URL;$S11URL; ${HDPREPO}/repoinfo.xml   
${HDPREPO}/repoinfo.xml.tmp; mv ${HDPREPO}/repoinfo.xml.tmp 
${HDPREPO}/repoinfo.xml
+
+  echo Setting ubuntu12 stack url to '$U12URL'
+  sed  s;REPLACE_WITH_UBUNTU12_URL;$U12URL; ${HDPREPO}/repoinfo.xml   
${HDPREPO}/repoinfo.xml.tmp; mv ${HDPREPO}/repoinfo.xml.tmp 
${HDPREPO}/repoinfo.xml
 fi

http://git-wip-us.apache.org/repos/asf/ambari/blob/1559/ambari-server/src/main/resources/stacks/HDP/2.1/repos/repoinfo.xml
--
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/repos/repoinfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.1/repos/repoinfo.xml
index cddd701..0f5f61a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/repos/repoinfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/repos/repoinfo.xml
@@ -72,4 +72,11 @@
   reponameHDP/reponame
 /repo
   /os
+  os type=ubuntu12
+repo
+  baseurlREPLACE_WITH_UBUNTU12_URL/baseurl
+  repoidHDP-2.1/repoid
+  reponameHDP/reponame
+/repo
+  /os
 /reposinfo



git commit: AMBARI-5284. Unit test test_start (TestAmbariServer.TestAmbariServer) fails intermittently (dlysnichenko)

2014-03-31 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 15593 - ac875fcc5


AMBARI-5284. Unit test test_start (TestAmbariServer.TestAmbariServer) fails 
intermittently (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: ac875fcc5ca17aa40d6c04d1609ca77ea8ec8a85
Parents: 155
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Mar 31 19:36:07 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Mar 31 19:36:07 2014 +0300

--
 .../src/test/python/TestAmbariServer.py | 532 +--
 1 file changed, 266 insertions(+), 266 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ac875fcc/ambari-server/src/test/python/TestAmbariServer.py
--
diff --git a/ambari-server/src/test/python/TestAmbariServer.py 
b/ambari-server/src/test/python/TestAmbariServer.py
index d97d072..d7de77f 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -2442,272 +2442,272 @@ 
MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
 self.assertEqual(None, rcode)
 self.assertTrue(setup_db_mock.called)
 
-# BUG-15593 - Commented out intermittent failure
-#  @patch.object(ambari_server, 'is_server_runing')
-#  @patch(os.chown)
-#  @patch(pwd.getpwnam)
-#  @patch.object(ambari_server, 'get_master_key_location')
-#  @patch.object(ambari_server, 'save_master_key')
-#  @patch('os.chmod', autospec=True)
-#  @patch.object(ambari_server, 'get_validated_string_input')
-#  @patch(os.environ)
-#  @patch.object(ambari_server, get_ambari_properties)
-#  @patch(os.path.exists)
-#  @patch(__builtin__.open)
-#  @patch(subprocess.Popen)
-#  @patch.object(ambari_server, print_info_msg)
-#  @patch.object(ambari_server, search_file)
-#  @patch.object(ambari_server, find_jdk)
-#  @patch.object(ambari_server, print_error_msg)
-#  @patch.object(ambari_server, check_postgre_up)
-#  @patch.object(ambari_server, parse_properties_file)
-#  @patch.object(ambari_server, read_ambari_user)
-#  @patch.object(ambari_server, is_root)
-#  @patch.object(ambari_server, find_jdbc_driver)
-#  @patch(getpass.getuser)
-#  @patch(os.chdir)
-#  @patch.object(ResourceFilesKeeper, perform_housekeeping)
-#  def test_start(self, perform_housekeeping_mock, chdir_mock, getuser_mock,
-# find_jdbc_driver_mock, is_root_mock, read_ambari_user_mock,
-# parse_properties_file_mock, check_postgre_up_mock,
-# print_error_msg_mock, find_jdk_mock, search_file_mock,
-# print_info_msg_mock, popenMock, openMock, pexistsMock,
-# get_ambari_properties_mock, os_environ_mock,
-# get_validated_string_input_method, os_chmod_method,
-# save_master_key_method, get_master_key_location_method,
-# getpwnam_mock, os_chown_mock, is_server_running_mock):
-#args = MagicMock()
-#
-#f = MagicMock()
-#f.readline.return_value = 42
-#openMock.return_value = f
-#
-#p = get_ambari_properties_mock.return_value
-#p.get_property.return_value = 'False'
-#search_file_mock.return_value = None
-#is_server_running_mock.return_value = (True, 123)
-#pw = MagicMock()
-#pw.setattr('pw_uid', 0)
-#pw.setattr('pw_gid', 0)
-#getpwnam_mock.return_value = pw
-#os_chown_mock.return_value = None
-## Checking server is running
-#pexistsMock.return_value = True
-#try:
-#  ambari_server.start(args)
-#  self.fail(Should fail with 'Server is running')
-#except FatalException:
-#  # Expected
-#  pass
-#
-#parse_properties_file_mock.reset_mock()
-#
-#pexistsMock.return_value = False
-#
-## Checking situation when ambari user is not set up
-#read_ambari_user_mock.return_value = None
-#try:
-#  ambari_server.start(args)
-#  self.fail(Should fail with 'Can not detect a system user for Ambari')
-#except FatalException as e:
-#  # Expected
-#  self.assertTrue('Unable to detect a system user for Ambari Server.' in 
e.reason)
-#
-#parse_properties_file_mock.reset_mock()
-#
-## Checking start from non-root when current user is not the same as a
-## custom user
-#read_ambari_user_mock.return_value = dummy-user
-#getuser_mock.return_value = non_custom_user
-#is_root_mock.return_value = False
-#try:
-#  ambari_server.start(args)
-#  self.fail(Should fail with 'Can not start ambari-server as user...')
-#except FatalException as e:
-#  # 

git commit: AMBARI-5299. Updated ganglia service description (dlysnichenko)

2014-04-01 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 278a18993 - 848bda46b


AMBARI-5299. Updated ganglia service description (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 848bda46b982be595a930431de9bdd47a35d3575
Parents: 278a189
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Apr 1 17:15:48 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Apr 1 17:16:42 2014 +0300

--
 .../main/resources/stacks/HDP/1.3.2/services/GANGLIA/metainfo.xml  | 2 +-
 .../main/resources/stacks/HDP/2.0.6/services/GANGLIA/metainfo.xml  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/848bda46/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/metainfo.xml
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/metainfo.xml
index 036b1be..6aa5b42 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/GANGLIA/metainfo.xml
@@ -20,7 +20,7 @@
   services
 service
   nameGANGLIA/name
-  commentGanglia Metrics Collection system/comment
+  commentGanglia Metrics Collection system (lt;a 
href=quot;http://oss.oetiker.ch/rrdtool/quot; 
target=quot;_blankquot;gt;RRDToollt;/agt; will be installed too)/comment
   version3.5.0/version
   components
 component

http://git-wip-us.apache.org/repos/asf/ambari/blob/848bda46/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/metainfo.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/metainfo.xml
index 409cd7b..f9a4c11 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/metainfo.xml
@@ -20,7 +20,7 @@
   services
 service
   nameGANGLIA/name
-  commentGanglia Metrics Collection system/comment
+  commentGanglia Metrics Collection system (lt;a 
href=quot;http://oss.oetiker.ch/rrdtool/quot; 
target=quot;_blankquot;gt;RRDToollt;/agt; will be installed too)/comment
   version3.5.0/version
   components
 component



git commit: AMBARI-5278. Review Falcon Configs in Ambari. (dlysnichenko)

2014-04-01 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 848bda46b - 0a702395e


AMBARI-5278. Review Falcon Configs in Ambari. (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 0a702395e5a09743b14574247ba42092cdc4dc6f
Parents: 848bda4
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Apr 1 17:19:51 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Apr 1 17:19:51 2014 +0300

--
 .../configuration/falcon-startup.properties.xml |  34 ++--
 .../services/FALCON/configuration/global.xml|  16 ++
 .../services/FALCON/package/scripts/falcon.py   |  18 +--
 .../services/FALCON/package/scripts/params.py   |  10 +-
 .../FALCON/package/scripts/service_check.py |   7 +-
 .../FALCON/package/templates/falcon-env.sh.j2   |   8 +-
 .../stacks/2.1/FALCON/test_falcon_server.py |   6 +-
 .../stacks/2.1/FALCON/test_service_check.py |  14 +-
 .../test/python/stacks/2.1/configs/default.json | 162 +--
 9 files changed, 133 insertions(+), 142 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/0a702395/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/configuration/falcon-startup.properties.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/configuration/falcon-startup.properties.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/configuration/falcon-startup.properties.xml
index e24590f..9746e24 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/configuration/falcon-startup.properties.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/configuration/falcon-startup.properties.xml
@@ -19,11 +19,7 @@
  */
 --
 configuration
-  property
-name*.domain/name
-value${falcon.app.type}/value
-description/description
-  /property
+  !--advanced properties--
   property
 name*.workflow.engine.impl/name
 valueorg.apache.falcon.workflow.engine.OozieWorkflowEngine/value
@@ -71,11 +67,6 @@
 description/description
   /property
   property
-nameprism.application.services/name
-valueorg.apache.falcon.entity.store.ConfigurationStore/value
-description/description
-  /property
-  property
 name*.configstore.listeners/name
 valueorg.apache.falcon.entity.v0.EntityGraph,\
   org.apache.falcon.entity.ColoClusterRelation,\
@@ -85,14 +76,6 @@
 description/description
   /property
   property
-nameprism.configstore.listeners/name
-valueorg.apache.falcon.entity.v0.EntityGraph,\
-  org.apache.falcon.entity.ColoClusterRelation,\
-  org.apache.falcon.group.FeedGroupMap
-/value
-description/description
-  /property
-  property
 name*.broker.impl.class/name
 valueorg.apache.activemq.ActiveMQConnectionFactory/value
 description/description
@@ -102,24 +85,25 @@
 
valueactivemq-core,ant,geronimo-j2ee-management,hadoop-distcp,jms,json-simple,oozie-client,spring-jms/value
 description/description
   /property
+  !--common properties--
+  property
+name*.domain/name
+value${falcon.app.type}/value
+description/description
+  /property
   property
 name*.config.store.uri/name
-valuefile://${falcon.home}/store/value
+valuefile:///hadoop/falcon/store/value
 descriptionLocation to store user entity configurations/description
   /property
   property
   /property
   property
 name*.system.lib.location/name
-value${falcon.home}/server/webapp/falcon/WEB-INF/lib/value
+value${falcon.home}/server/webapp/${falcon.app.type}/WEB-INF/lib/value
 descriptionLocation of libraries that is shipped to Hadoop/description
   /property
   property
-nameprism.system.lib.location/name
-value${falcon.home}/server/webapp/prism/WEB-INF/lib/value
-description/description
-  /property
-  property
 name*.retry.recorder.path/name
 value${falcon.log.dir}/retry/value
 description/description

http://git-wip-us.apache.org/repos/asf/ambari/blob/0a702395/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/configuration/global.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/configuration/global.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/configuration/global.xml
index 9732304..c26d9ea 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/configuration/global.xml
+++ 

[1/3] AMBARI-5245. gmond.master.conf files are generated by Ganglia Server (dlysnichenko)

2014-04-01 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 0efe870da - 8d2e94af8


http://git-wip-us.apache.org/repos/asf/ambari/blob/8d2e94af/ambari-server/src/test/python/stacks/2.0.6/configs/default.non_gmetad_host.json
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/configs/default.non_gmetad_host.json
 
b/ambari-server/src/test/python/stacks/2.0.6/configs/default.non_gmetad_host.json
new file mode 100644
index 000..c835c94
--- /dev/null
+++ 
b/ambari-server/src/test/python/stacks/2.0.6/configs/default.non_gmetad_host.json
@@ -0,0 +1,660 @@
+{
+roleCommand: SERVICE_CHECK, 
+clusterName: c1, 
+hostname: c6401.ambari.apache.org, 
+hostLevelParams: {
+jdk_location: http://c6401.ambari.apache.org:8080/resources/;, 
+ambari_db_rca_password: mapred, 
+ambari_db_rca_url: 
jdbc:postgresql://c6401.ambari.apache.org/ambarirca, 
+jce_name: UnlimitedJCEPolicyJDK7.zip, 
+stack_version: 2.0,
+stack_name: HDP, 
+ambari_db_rca_driver: org.postgresql.Driver, 
+jdk_name: jdk-7u45-linux-x64.tar.gz, 
+ambari_db_rca_username: mapred, 
+java_home: /usr/jdk64/jdk1.7.0_45,
+db_name: ambari
+}, 
+commandType: EXECUTION_COMMAND, 
+roleParams: {}, 
+serviceName: OOZIE, 
+role: OOZIE_SERVICE_CHECK, 
+commandParams: {
+command_timeout: 300, 
+service_package_folder: OOZIE,
+script_type: PYTHON, 
+schema_version: 2.0, 
+script: scripts/service_check.py,
+excluded_hosts: host1,host2,
+mark_draining_only : false
+},
+taskId: 152, 
+public_hostname: c6401.ambari.apache.org, 
+configurations: {
+mapred-site: {
+mapreduce.jobhistory.address: c6402.ambari.apache.org:10020, 
+mapreduce.cluster.administrators:  hadoop, 
+mapreduce.reduce.input.buffer.percent: 0.0, 
+mapreduce.output.fileoutputformat.compress: false, 
+mapreduce.framework.name: yarn, 
+mapreduce.map.speculative: false, 
+mapreduce.reduce.shuffle.merge.percent: 0.66, 
+yarn.app.mapreduce.am.resource.mb: 683, 
+mapreduce.map.java.opts: -Xmx273m, 
+mapreduce.application.classpath: 
$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*,$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*,
 
+mapreduce.job.reduce.slowstart.completedmaps: 0.05, 
+mapreduce.output.fileoutputformat.compress.type: BLOCK, 
+mapreduce.reduce.speculative: false, 
+mapreduce.reduce.java.opts: -Xmx546m, 
+mapreduce.am.max-attempts: 2, 
+yarn.app.mapreduce.am.admin-command-opts: 
-Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN, 
+mapreduce.reduce.log.level: INFO, 
+mapreduce.map.sort.spill.percent: 0.7, 
+mapreduce.task.timeout: 30, 
+mapreduce.map.memory.mb: 341, 
+mapreduce.task.io.sort.factor: 100, 
+mapreduce.jobhistory.intermediate-done-dir: /mr-history/tmp, 
+mapreduce.reduce.memory.mb: 683, 
+yarn.app.mapreduce.am.log.level: INFO, 
+mapreduce.map.log.level: INFO, 
+mapreduce.shuffle.port: 13562, 
+mapreduce.admin.user.env: 
LD_LIBRARY_PATH=/usr/lib/hadoop/lib/native:/usr/lib/hadoop/lib/native/`$JAVA_HOME/bin/java
 -d32 -version amp;gt; /dev/null;if [ $? -eq 0 ]; then echo Linux-i386-32; 
else echo Linux-amd64-64;fi`, 
+mapreduce.map.output.compress: false, 
+yarn.app.mapreduce.am.staging-dir: /user, 
+mapreduce.reduce.shuffle.parallelcopies: 30, 
+mapreduce.reduce.shuffle.input.buffer.percent: 0.7, 
+mapreduce.jobhistory.webapp.address: 
c6402.ambari.apache.org:19888, 
+mapreduce.jobhistory.done-dir: /mr-history/done, 
+mapreduce.admin.reduce.child.java.opts: 
-Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN, 
+mapreduce.task.io.sort.mb: 136, 
+yarn.app.mapreduce.am.command-opts: -Xmx546m, 
+mapreduce.admin.map.child.java.opts: 
-Djava.net.preferIPv4Stack=true -Dhadoop.metrics.log.level=WARN
+}, 
+oozie-site: {
+oozie.service.PurgeService.purge.interval: 3600, 
+oozie.service.CallableQueueService.queue.size: 1000, 
+oozie.service.SchemaService.wf.ext.schemas: 
shell-action-0.1.xsd,email-action-0.1.xsd,hive-action-0.2.xsd,sqoop-action-0.2.xsd,ssh-action-0.1.xsd,distcp-action-0.1.xsd,shell-action-0.2.xsd,oozie-sla-0.1.xsd,oozie-sla-0.2.xsd,hive-action-0.3.xsd,
+oozie.service.JPAService.jdbc.url: 
jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true, 
+oozie.service.HadoopAccessorService.nameNode.whitelist:  , 
+use.system.libpath.for.mapreduce.and.pig.jobs: 

git commit: AMBARI-5350. Ambari should set hive.optimize.bucketmapjoin.sortedmerge=false in hive-site.xml (dlysnichenko)

2014-04-04 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 0ebb16dca - ad873dc39


AMBARI-5350. Ambari should set hive.optimize.bucketmapjoin.sortedmerge=false 
in hive-site.xml (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: ad873dc39715a5a1c7db1071b32f3fc390171475
Parents: 0ebb16d
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Apr 4 18:40:50 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Apr 4 18:40:50 2014 +0300

--
 .../stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml | 2 +-
 .../stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ad873dc3/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
index e5b8bf4..34e6231 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/configuration/hive-site.xml
@@ -168,7 +168,7 @@ limitations under the License.
 
   property
 namehive.optimize.bucketmapjoin.sortedmerge/name
-valuetrue/value
+valuefalse/value
 description If the tables being joined are sorted and bucketized on the 
join columns, and they have the same number
   of buckets, a sort-merge join can be performed by setting this parameter 
as true.
 /description

http://git-wip-us.apache.org/repos/asf/ambari/blob/ad873dc3/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
index bfdc8ac..1e4ba38 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/configuration/hive-site.xml
@@ -181,7 +181,7 @@ limitations under the License.
 
   property
 namehive.optimize.bucketmapjoin.sortedmerge/name
-valuetrue/value
+valuefalse/value
 description If the tables being joined are sorted and bucketized on the 
join columns, and they have the same number
 of buckets, a sort-merge join can be performed by setting this parameter 
as true.
 /description



git commit: AMBARI-5353. Falcon directory ownership set incorrectly (dlysnichenko)

2014-04-04 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 82ebd6d5a - b6c5f57b8


AMBARI-5353. Falcon directory ownership set incorrectly (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: b6c5f57b815b1c0c8810cb5487931d788a8e7534
Parents: 82ebd6d
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Apr 4 20:54:35 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Apr 4 20:55:14 2014 +0300

--
 .../stacks/HDP/2.1/services/FALCON/package/scripts/falcon.py  | 3 +++
 .../src/test/python/stacks/2.1/FALCON/test_falcon_client.py   | 3 +++
 .../src/test/python/stacks/2.1/FALCON/test_falcon_server.py   | 3 +++
 3 files changed, 9 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/b6c5f57b/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/package/scripts/falcon.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/package/scripts/falcon.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/package/scripts/falcon.py
index c2455bf..88c1f6c 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/package/scripts/falcon.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.1/services/FALCON/package/scripts/falcon.py
@@ -31,6 +31,9 @@ def falcon(type, action = None):
 Directory(params.falcon_webapp_dir,
   owner=params.falcon_user
 )
+Directory(params.falcon_home,
+  owner=params.falcon_user
+)
 File(params.falcon_conf_dir + '/falcon-env.sh',
  content=Template('falcon-env.sh.j2')
 )

http://git-wip-us.apache.org/repos/asf/ambari/blob/b6c5f57b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py 
b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py
index c475bf8..2153e41 100644
--- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py
+++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_client.py
@@ -37,6 +37,9 @@ class TestFalconClient(RMFTestCase):
 self.assertResourceCalled('Directory', '/var/lib/falcon/webapp',
   owner = 'falcon',
   )
+self.assertResourceCalled('Directory', '/usr/lib/falcon',
+  owner = 'falcon',
+  )
 self.assertResourceCalled('File', '/etc/falcon/conf/falcon-env.sh',
   content = Template('falcon-env.sh.j2'),
   )

http://git-wip-us.apache.org/repos/asf/ambari/blob/b6c5f57b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py 
b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
index 0f85cdc..2fa61a1 100644
--- a/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
+++ b/ambari-server/src/test/python/stacks/2.1/FALCON/test_falcon_server.py
@@ -68,6 +68,9 @@ class TestFalconServer(RMFTestCase):
 self.assertResourceCalled('Directory', '/var/lib/falcon/webapp',
   owner = 'falcon',
   )
+self.assertResourceCalled('Directory', '/usr/lib/falcon',
+  owner = 'falcon',
+  )
 self.assertResourceCalled('File', '/etc/falcon/conf/falcon-env.sh',
   content = Template('falcon-env.sh.j2'),
   )



git commit: AMBARI-5357. Hive service check tests try to access external host and slow down test runs (dlysnichenko)

2014-04-04 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk ad88bd14f - 78fc98468


AMBARI-5357. Hive service check tests try to access external host and slow down 
test runs (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 78fc98468e53bc99ded9faf0794106fa1da8d31c
Parents: ad88bd1
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Apr 4 21:16:37 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Apr 4 21:17:21 2014 +0300

--
 .../src/test/python/stacks/1.3.2/HIVE/test_hive_service_check.py  | 3 ++-
 .../src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/78fc9846/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_service_check.py
--
diff --git 
a/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_service_check.py 
b/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_service_check.py
index 237be7a..bd2388b 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_service_check.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hive_service_check.py
@@ -19,9 +19,10 @@ limitations under the License.
 '''
 from mock.mock import MagicMock, call, patch
 from stacks.utils.RMFTestCase import *
-import datetime
+import datetime, socket
 import  resource_management.libraries.functions
 @patch.object(resource_management.libraries.functions, 
get_unique_id_and_date, new = MagicMock(return_value=''))
+@patch(socket.socket, new = MagicMock())
 class TestServiceCheck(RMFTestCase):
 
   @patch(sys.exit)

http://git-wip-us.apache.org/repos/asf/ambari/blob/78fc9846/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
--
diff --git 
a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py 
b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
index 7eb5810..00c24d4 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
@@ -19,9 +19,10 @@ limitations under the License.
 '''
 from mock.mock import MagicMock, call, patch
 from stacks.utils.RMFTestCase import *
-import datetime, sys
+import datetime, sys, socket
 import  resource_management.libraries.functions
 @patch.object(resource_management.libraries.functions, 
get_unique_id_and_date, new = MagicMock(return_value=''))
+@patch(socket.socket, new = MagicMock())
 class TestServiceCheck(RMFTestCase):
 
   @patch(sys.exit)



git commit: AMBARI-5359. unittest NagiosPropertyProviderTest fails (dlysnichenko)

2014-04-04 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk be82b987c - 14a44ea8a


AMBARI-5359. unittest NagiosPropertyProviderTest fails (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 14a44ea8ace8ef0e2c9faf55909c333fe0832700
Parents: be82b98
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Apr 4 23:27:56 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Apr 4 23:28:49 2014 +0300

--
 .../nagios/NagiosPropertyProviderTest.java  | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/14a44ea8/ambari-server/src/test/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProviderTest.java
index 9f3ff85..b0cf585 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/nagios/NagiosPropertyProviderTest.java
@@ -103,6 +103,7 @@ public class NagiosPropertyProviderTest {
 streamProvider,
 ServiceInfo/cluster_name,
 ServiceInfo/service_name);
+npp.forceReset();
 
 Resource resource = new ResourceImpl(Resource.Type.Service);
 resource.setProperty(ServiceInfo/cluster_name, c1);
@@ -130,6 +131,7 @@ public class NagiosPropertyProviderTest {
 streamProvider,
 ServiceInfo/cluster_name,
 ServiceInfo/service_name);
+npp.forceReset();
 
 Resource resource = new ResourceImpl(Resource.Type.Service);
 resource.setProperty(ServiceInfo/cluster_name, null);
@@ -146,13 +148,25 @@ public class NagiosPropertyProviderTest {
   
   @Test
   public void testNoNagiosServerCompoonent() throws Exception {
-
+
+Cluster cluster = clusters.getCluster(c1);
+reset(cluster);
+
+Service nagiosService = createMock(Service.class);
+expect(cluster.getService(NAGIOS)).andReturn(nagiosService);
+
+ServiceComponent nagiosServiceComponent = 
createMock(ServiceComponent.class);
+expect(nagiosService.getServiceComponent(NAGIOS_SERVER)).andThrow(new 
AmbariException(No Component));
+
+replay(cluster, nagiosService);
+
 TestStreamProvider streamProvider = new 
TestStreamProvider(nagios_alerts.txt);
 
 NagiosPropertyProvider npp = new 
NagiosPropertyProvider(Resource.Type.Service,
 streamProvider,
 ServiceInfo/cluster_name,
 ServiceInfo/service_name);
+npp.forceReset();
 
 Resource resource = new ResourceImpl(Resource.Type.Service);
 resource.setProperty(ServiceInfo/cluster_name, c1);



git commit: AMBARI-5428. failing testGenerateManifest, test_overwrite_repos (dlysnichenko)

2014-04-10 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 1c056ac1d - f0c0c2ef3


AMBARI-5428. failing testGenerateManifest, test_overwrite_repos (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: f0c0c2ef3ac8ac69a6f13984d9b21ff88262b9ad
Parents: 1c056ac
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Apr 10 21:05:39 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Apr 10 21:05:39 2014 +0300

--
 .../test/python/ambari_agent/TestManifestGenerator.py| 11 +++
 .../src/test/python/ambari_agent/TestPuppetExecutor.py   |  8 +++-
 2 files changed, 14 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f0c0c2ef/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py 
b/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py
index 7e6ab81..6256460 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py
@@ -63,21 +63,24 @@ class TestManifestGenerator(TestCase):
 
 pass
 
+  @patch.object(manifestGenerator, 'writeHostnames')
   @patch.object(manifestGenerator, 'writeImports')
   @patch.object(manifestGenerator, 'writeNodes')
   @patch.object(manifestGenerator, 'writeParams')
   @patch.object(manifestGenerator, 'writeTasks')
   @patch.object(manifestGenerator, 'decompressClusterHostInfo')
-  def testGenerateManifest(self, decompressClusterHostInfoMock, 
writeTasksMock, writeParamsMock, writeNodesMock, writeImportsMock):
+  def testGenerateManifest(self, decompressClusterHostInfoMock, writeTasksMock,
+   writeParamsMock, writeNodesMock, writeImportsMock, 
writeHostnamesMock):
 tmpFileName = tempfile.mkstemp(dir=self.dir, text=True)[1]
 self.parsedJson['roleParams'] = 'role param'
 manifestGenerator.generateManifest(self.parsedJson, tmpFileName, 
'../../main/puppet/modules', self.config.getConfig())
 
-self.assertTrue(writeParamsMock.called)
-self.assertTrue(writeNodesMock.called)
+self.assertTrue(decompressClusterHostInfoMock.called)
 self.assertTrue(writeImportsMock.called)
+self.assertTrue(writeHostnamesMock.called)
+self.assertTrue(writeNodesMock.called)
+self.assertTrue(writeParamsMock.called)
 self.assertTrue(writeTasksMock.called)
-self.assertTrue(decompressClusterHostInfoMock.called)
 
 print file(tmpFileName).read()
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f0c0c2ef/ambari-agent/src/test/python/ambari_agent/TestPuppetExecutor.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestPuppetExecutor.py 
b/ambari-agent/src/test/python/ambari_agent/TestPuppetExecutor.py
index c5c3bdc..4c3c97f 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestPuppetExecutor.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestPuppetExecutor.py
@@ -113,10 +113,12 @@ class TestPuppetExecutor(TestCase):
 self.assertEquals(res[stderr], Cannot access JDK! Make sure java_home 
is specified in hostLevelParams)
 
 
+  @patch.object(manifestGenerator, 'generateManifest')
   @patch.object(PuppetExecutor, 'isJavaAvailable')
   @patch.object(RepoInstaller, 'generate_repo_manifests')
   @patch.object(PuppetExecutor, 'runPuppetFile')
-  def test_overwrite_repos(self, runPuppetFileMock, generateRepoManifestMock, 
isJavaAvailableMock):
+  def test_overwrite_repos(self, runPuppetFileMock, generateRepoManifestMock,
+   isJavaAvailableMock, generateManifestMock):
 tmpdir = tempfile.gettempdir()
 puppetInstance = PuppetExecutor(/tmp, /x, /y, tmpdir, 
AmbariConfig().getConfig())
 jsonFile = open('../../main/python/ambari_agent/test.json', 'r')
@@ -124,6 +126,10 @@ class TestPuppetExecutor(TestCase):
 parsedJson = json.loads(jsonStr)
 parsedJson[taskId] = 77
 parsedJson['roleCommand'] = START
+def side_effect_generate_manifest(command, siteppFileName,
+  modulesdir, config):
+  return None
+generateManifestMock.side_effect = side_effect_generate_manifest
 def side_effect(puppetFile, result, puppetEnv, tmpoutfile, tmperrfile, 
timeout):
   result[exitcode] = 0
 runPuppetFileMock.side_effect = side_effect



git commit: AMBARI-4979. Limiting Ambari version to 3 digits (dlysnichenko)

2014-04-10 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk f0c0c2ef3 - 60dc78f95


AMBARI-4979. Limiting Ambari version to 3 digits (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 60dc78f95dd2dbcc7de4ad69e0b305b63acab076
Parents: f0c0c2e
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Apr 10 21:45:50 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Apr 10 21:45:50 2014 +0300

--
 ambari-agent/pom.xml|  6 ++--
 .../src/main/package/deb/control/control|  2 +-
 .../src/main/package/deb/control/control|  2 +-
 ambari-server/pom.xml   |  7 ++--
 .../src/main/package/deb/control/control|  2 +-
 ambari-views/pom.xml|  3 +-
 ambari-web/pom.xml  |  4 +--
 pom.xml | 35 
 8 files changed, 48 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/60dc78f9/ambari-agent/pom.xml
--
diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index 871581a..d072e0f 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -89,8 +89,8 @@
 configuration
   nameambariVersion/name
   value${project.version}/value
-  regex-SNAPSHOT/regex
-  replacement/replacement
+  regex^([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-).*/regex
+  replacement$1.$2.$3/replacement
   failIfNoMatchfalse/failIfNoMatch
 /configuration
   /execution
@@ -397,7 +397,7 @@
 /executions
 configuration
   controlDir${basedir}/src/main/package/deb/control/controlDir
-  deb${basedir}/target/${artifactId}_${version}.deb/deb
+  
deb${basedir}/target/${artifactId}_${package-version}-${package-release}.deb/deb
   dataSet
 data
   
src${project.build.directory}/${project.artifactId}-${project.version}/ambari_agent/src

http://git-wip-us.apache.org/repos/asf/ambari/blob/60dc78f9/ambari-agent/src/main/package/deb/control/control
--
diff --git a/ambari-agent/src/main/package/deb/control/control 
b/ambari-agent/src/main/package/deb/control/control
index 4ea7f6c..40cd855 100644
--- a/ambari-agent/src/main/package/deb/control/control
+++ b/ambari-agent/src/main/package/deb/control/control
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License
 Package: [[artifactId]]
-Version: [[version]]
+Version: [[package-version]]-[[package-release]]
 Section: [[deb.section]]
 Priority: [[deb.priority]]
 Depends: [[deb.dependency.list]]

http://git-wip-us.apache.org/repos/asf/ambari/blob/60dc78f9/ambari-project/src/main/package/deb/control/control
--
diff --git a/ambari-project/src/main/package/deb/control/control 
b/ambari-project/src/main/package/deb/control/control
index e37581a..d00c2cd 100644
--- a/ambari-project/src/main/package/deb/control/control
+++ b/ambari-project/src/main/package/deb/control/control
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License
 Package: [[artifactId]]
-Version: [[version]]
+Version: [[package-version]]-[[package-release]]
 Section: [[deb.section]]
 Priority: [[deb.priority]]
 Architecture: [[deb.architecture]]

http://git-wip-us.apache.org/repos/asf/ambari/blob/60dc78f9/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 2301b53..c2cb0e5 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -56,8 +56,8 @@
 configuration
   nameambariVersion/name
   value${project.version}/value
-  regex-SNAPSHOT/regex
-  replacement/replacement
+  regex^([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-).*/regex
+  replacement$1.$2.$3/replacement
   failIfNoMatchfalse/failIfNoMatch
 /configuration
   /execution
@@ -196,7 +196,6 @@
 /executions
 configuration
   copyright2012, Apache Software Foundation/copyright
-  version${project.version}/version
   groupDevelopment/group
   descriptionMaven Recipe: RPM Package./description
 

git commit: AMBARI-5480. There's significant lag for the Restart Indicators to go away after restarting (dlysnichenko)

2014-04-17 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 8b385e075 - e445a9ce4


AMBARI-5480. There's significant lag for the Restart Indicators to go away 
after restarting (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: e445a9ce487d2486a556b29b693c6083ffd396f3
Parents: 8b385e0
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Apr 17 16:37:49 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Apr 17 16:37:49 2014 +0300

--
 .../src/main/python/ambari_agent/ActionQueue.py |   4 +
 .../test/python/ambari_agent/TestActionQueue.py |  11 +-
 .../ambari/server/agent/CommandReport.java  |  15 +-
 .../ambari/server/agent/HeartBeatHandler.java   |  27 +++-
 .../server/agent/TestHeartbeatHandler.java  | 156 +++
 5 files changed, 205 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/e445a9ce/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py 
b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index 53191d7..221bf27 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -208,6 +208,10 @@ class ActionQueue(threading.Thread):
 if roleResult['stderr'] == '':
   roleResult['stderr'] = 'None'
 
+# let ambari know name of custom command
+if command['hostLevelParams'].has_key('custom_command'):
+  roleResult['customCommand'] = 
command['hostLevelParams']['custom_command']
+
 if 'structuredOut' in commandresult:
   roleResult['structuredOut'] = str(commandresult['structuredOut'])
 else:

http://git-wip-us.apache.org/repos/asf/ambari/blob/e445a9ce/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py 
b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
index bf93c10..7dc80c7 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestActionQueue.py
@@ -57,6 +57,7 @@ class TestActionQueue(TestCase):
 'taskId': 3,
 'clusterName': u'cc',
 'serviceName': u'HDFS',
+'hostLevelParams': {},
 'configurations':{'global' : {}},
 'configurationTags':{'global' : { 'tag': 'v1' }}
   }
@@ -69,7 +70,7 @@ class TestActionQueue(TestCase):
   'serviceName' : serviceName,
   'roleCommand' : 'UPGRADE',
   'hostname' : localhost.localdomain,
-  'hostLevelParams': hostLevelParams,
+  'hostLevelParams': {},
   'clusterHostInfo': clusterHostInfo,
   'commandType': EXECUTION_COMMAND,
   'configurations':{'global' : {}},
@@ -88,6 +89,7 @@ class TestActionQueue(TestCase):
 'taskId': 4,
 'clusterName': u'cc',
 'serviceName': u'HDFS',
+'hostLevelParams': {}
 }
 
   snamenode_install_command = {
@@ -98,6 +100,7 @@ class TestActionQueue(TestCase):
 'taskId': 5,
 'clusterName': u'cc',
 'serviceName': u'HDFS',
+'hostLevelParams': {}
 }
 
   nagios_install_command = {
@@ -108,6 +111,7 @@ class TestActionQueue(TestCase):
 'taskId': 6,
 'clusterName': u'cc',
 'serviceName': u'HDFS',
+'hostLevelParams': {}
 }
 
   hbase_install_command = {
@@ -118,6 +122,7 @@ class TestActionQueue(TestCase):
 'taskId': 7,
 'clusterName': u'cc',
 'serviceName': u'HDFS',
+'hostLevelParams': {}
 }
 
   status_command = {
@@ -125,7 +130,8 @@ class TestActionQueue(TestCase):
 commandType : STATUS_COMMAND,
 clusterName : ,
 componentName : DATANODE,
-'configurations':{}
+'configurations':{},
+'hostLevelParams': {}
   }
 
   datanode_restart_command = {
@@ -411,6 +417,7 @@ class TestActionQueue(TestCase):
 'roleCommand': u'CUSTOM_COMMAND',
 'serviceName': u'HDFS',
 'status': 'COMPLETED',
+'customCommand': 'RESTART',
 'stderr': 'stderr',
 'stdout': 'out',
 'structuredOut': '',

http://git-wip-us.apache.org/repos/asf/ambari/blob/e445a9ce/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandReport.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/agent/CommandReport.java 

git commit: AMBARI-5497. Ambari-server states it has started but it actually errored. (dlysnichenko)

2014-04-18 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 68147d53c - f83d95df7


AMBARI-5497. Ambari-server states it has started but it actually errored. 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: f83d95df736e83c02d5f2d4c97e2493b96b33768
Parents: 68147d5
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Apr 18 15:32:58 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Apr 18 15:35:10 2014 +0300

--
 ambari-server/src/main/python/ambari-server.py  | 31 +++-
 .../src/test/python/TestAmbariServer.py | 23 ++-
 2 files changed, 46 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/f83d95df/ambari-server/src/main/python/ambari-server.py
--
diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index fb8c311..f74ef29 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -2008,21 +2008,38 @@ def get_JAVA_HOME():
 
 
 #
+# Checks jdk path for correctness
+#
+def validate_jdk(jdk_path):
+  if jdk_path:
+return os.path.exists(jdk_path) and os.path.exists(
+  jdk_path + os.sep + 'bin' + os.sep + 'java')
+  else:
+return False
+
+
+#
 # Finds the available JDKs.
 #
 def find_jdk():
-  if get_JAVA_HOME():
-return get_JAVA_HOME()
+  jdkPath = get_JAVA_HOME()
+  if jdkPath:
+if validate_jdk(jdkPath):
+  return jdkPath
   print Looking for available JDKs at  + JDK_INSTALL_DIR
   jdks = glob.glob(JDK_INSTALL_DIR + os.sep + jdk*)
   jdks.sort()
   print Found:  + str(jdks)
-  count = len(jdks)
-  if count == 0:
+  if len(jdks) == 0:
 return
-  jdkPath = jdks[count - 1]
-  print Selected JDK {0}.format(jdkPath)
-  return jdkPath
+  for jdkPath in jdks:
+print Trying to use JDK {0}.format(jdkPath)
+if validate_jdk(jdkPath):
+  print Selected JDK {0}.format(jdkPath)
+  return jdkPath
+else:
+  print JDK {0} is invalid.format(jdkPath)
+  return
 
 
 #

http://git-wip-us.apache.org/repos/asf/ambari/blob/f83d95df/ambari-server/src/test/python/TestAmbariServer.py
--
diff --git a/ambari-server/src/test/python/TestAmbariServer.py 
b/ambari-server/src/test/python/TestAmbariServer.py
index f1b52cc..56814a2 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -2173,10 +2173,26 @@ 
MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
 self.assertEqual(args.database_username, ambari-server)
 self.assertEqual(args.sid_or_sname, sname)
 
+  @patch.object(os.path, exists)
+  def test_validate_jdk(self, exists_mock):
+exists_mock.side_effect = [False]
+result = ambari_server.validate_jdk(path)
+self.assertFalse(result)
+
+exists_mock.side_effect = [True, False]
+result = ambari_server.validate_jdk(path)
+self.assertFalse(result)
+
+exists_mock.side_effect = [True, True]
+result = ambari_server.validate_jdk(path)
+self.assertTrue(result)
+
   @patch(glob.glob)
   @patch.object(ambari_server, get_JAVA_HOME)
-  def test_find_jdk(self, get_JAVA_HOME_mock, globMock):
+  @patch.object(ambari_server, validate_jdk)
+  def test_find_jdk(self, validate_jdk_mock, get_JAVA_HOME_mock, globMock):
 get_JAVA_HOME_mock.return_value = somewhere
+validate_jdk_mock.return_value = True
 result = ambari_server.find_jdk()
 self.assertEqual(somewhere, result)
 
@@ -2189,6 +2205,11 @@ 
MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
 result = ambari_server.find_jdk()
 self.assertNotEqual(None, result)
 
+globMock.return_value = [one, two]
+validate_jdk_mock.side_effect = [False, True]
+result = ambari_server.find_jdk()
+self.assertEqual(result, two)
+
   @patch(os.path.exists)
   @patch.object(ambari_server, remove_file)
   @patch.object(ambari_server, is_jdbc_user_changed)



git commit: AMBARI-5532. Bootstrap fails on ubuntu (dlysnichenko)

2014-04-23 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 841a69d28 - 11c63bc57


AMBARI-5532. Bootstrap fails on ubuntu (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 11c63bc572db7486e98d52c6dec0046ec2f6d0d9
Parents: 841a69d
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Apr 23 15:30:12 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Apr 23 15:30:12 2014 +0300

--
 ambari-server/src/main/python/bootstrap.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/11c63bc5/ambari-server/src/main/python/bootstrap.py
--
diff --git a/ambari-server/src/main/python/bootstrap.py 
b/ambari-server/src/main/python/bootstrap.py
index f2548a8..9e5ae1b 100755
--- a/ambari-server/src/main/python/bootstrap.py
+++ b/ambari-server/src/main/python/bootstrap.py
@@ -274,7 +274,7 @@ class Bootstrap(threading.Thread):
   return self.getMoveRepoFileWithoutPasswordCommand(targetDir)
 
   def getAptUpdateCommand(self):
-return apt-get update -o Dir::Etc::sourcelist=\%s/%s\ -o 
API::Get::List-Cleanup=\0\ --no-list-cleanup %\
+return sudo apt-get update -o Dir::Etc::sourcelist=\%s/%s\ -o 
API::Get::List-Cleanup=\0\ --no-list-cleanup %\
   (sources.list.d, self.AMBARI_REPO_FILENAME)
 
   def copyNeededFiles(self):



[1/2] git commit: AMBARI-5633. Start Services command gets stuck for about 30 mins (dlysnichenko)

2014-04-30 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-1.6.0 11819ace2 - 532898340
  refs/heads/trunk b4d35ac31 - 9a245cbc4


AMBARI-5633. Start Services command gets stuck for about 30 mins (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 9a245cbc4ebb3cf740930613f8e34dd01976554c
Parents: b4d35ac
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Apr 30 14:54:43 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Apr 30 14:54:43 2014 +0300

--
 .../python/ambari_agent/CommandStatusDict.py|  5 +++-
 .../src/main/python/ambari_agent/hostname.py| 28 +++-
 .../ambari_agent/TestCommandStatusDict.py   | 22 +++
 .../test/python/ambari_agent/TestHostname.py| 21 ++-
 4 files changed, 67 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/9a245cbc/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py 
b/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py
index 15e7e2e..e491e09 100644
--- a/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py
+++ b/ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py
@@ -49,11 +49,14 @@ class CommandStatusDict():
 
 if 'taskId' in command:
   key = command['taskId']
+  status_command = False
 else: # Status command reports has no task id
   key = id(command)
+  status_command = True
 with self.lock: # Synchronized
   self.current_state[key] = (command, new_report)
-self.callback_action()
+if not status_command:
+  self.callback_action()
 
 
   def generate_report(self):

http://git-wip-us.apache.org/repos/asf/ambari/blob/9a245cbc/ambari-agent/src/main/python/ambari_agent/hostname.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/hostname.py 
b/ambari-agent/src/main/python/ambari_agent/hostname.py
index 063351e..56031fc 100644
--- a/ambari-agent/src/main/python/ambari_agent/hostname.py
+++ b/ambari-agent/src/main/python/ambari_agent/hostname.py
@@ -27,7 +27,14 @@ import traceback
 
 logger = logging.getLogger()
 
+cached_hostname = None
+cached_public_hostname = None
+
 def hostname():
+  global cached_hostname
+  if cached_hostname is not None:
+return cached_hostname
+
   config = AmbariConfig.config
   try:
 scriptname = config.get('agent', 'hostname_script')
@@ -35,15 +42,20 @@ def hostname():
   osStat = subprocess.Popen([scriptname], stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)
   out, err = osStat.communicate()
   if (0 == osStat.returncode and 0 != len(out.strip())):
-return out.strip()
+cached_hostname = out.strip()
   else:
-return socket.getfqdn()
+cached_hostname = socket.getfqdn()
 except:
-  return socket.getfqdn()
+  cached_hostname = socket.getfqdn()
   except:
-return socket.getfqdn()
+cached_hostname = socket.getfqdn()
+  return cached_hostname
 
 def public_hostname():
+  global cached_public_hostname
+  if cached_public_hostname is not None:
+return cached_public_hostname
+
   config = AmbariConfig.config
   out = ''
   err = ''
@@ -53,7 +65,8 @@ def public_hostname():
   output = subprocess.Popen([scriptname], stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)
   out, err = output.communicate()
   if (0 == output.returncode and 0 != len(out.strip())):
-return out.strip()
+cached_public_hostname = out.strip()
+return cached_public_hostname
   except:
 #ignore for now. 
 trace_info = traceback.format_exc()
@@ -66,9 +79,10 @@ def public_hostname():
 handle = 
urllib2.urlopen('http://169.254.169.254/latest/meta-data/public-hostname', '', 
2)
 str = handle.read()
 handle.close()
-return str
+cached_public_hostname = str
   except Exception, e:
-return socket.getfqdn()
+cached_public_hostname = socket.getfqdn()
+  return cached_public_hostname
 
 def main(argv=None):
   print hostname()

http://git-wip-us.apache.org/repos/asf/ambari/blob/9a245cbc/ambari-agent/src/test/python/ambari_agent/TestCommandStatusDict.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestCommandStatusDict.py 
b/ambari-agent/src/test/python/ambari_agent/TestCommandStatusDict.py
index 8751479..32df30b 100644
--- 

git commit: AMBARI-5544. Deleted slave components stick around from the service's perspective (dlysnichenko)

2014-05-10 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk e49cf155c - 51b5433f5


AMBARI-5544. Deleted slave components stick around from the service's 
perspective (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 51b5433f560cacf6b69e0adef0cfd92b8e3a098c
Parents: e49cf15
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu May 8 17:57:49 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu May 8 17:57:49 2014 +0300

--
 .../AmbariManagementControllerImpl.java | 121 ---
 .../AmbariManagementControllerTest.java |  89 ++
 2 files changed, 166 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/51b5433f/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 94d3c62..6c88429 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
@@ -23,6 +23,21 @@ import com.google.inject.Inject;
 import com.google.inject.Injector;
 import com.google.inject.Singleton;
 import com.google.inject.persist.Transactional;
+import java.io.File;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.TreeMap;
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.ClusterNotFoundException;
 import org.apache.ambari.server.DuplicateResourceException;
@@ -41,8 +56,32 @@ import org.apache.ambari.server.actionmanager.RequestFactory;
 import org.apache.ambari.server.actionmanager.Stage;
 import org.apache.ambari.server.actionmanager.StageFactory;
 import org.apache.ambari.server.agent.ExecutionCommand;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AMBARI_DB_RCA_DRIVER;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AMBARI_DB_RCA_PASSWORD;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AMBARI_DB_RCA_URL;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AMBARI_DB_RCA_USERNAME;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.COMMAND_TIMEOUT;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_DRIVER_FILENAME;
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_NAME;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.HOOKS_FOLDER;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JAVA_HOME;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JCE_NAME;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_LOCATION;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_NAME;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.MYSQL_JDBC_URL;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.ORACLE_JDBC_URL;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.PACKAGE_LIST;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.REPO_INFO;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SCHEMA_VERSION;
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SCRIPT;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SCRIPT_TYPE;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SERVICE_PACKAGE_FOLDER;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SERVICE_REPO_INFO;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_NAME;
+import static 
org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_VERSION;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
 import org.apache.ambari.server.configuration.Configuration;
+import 

git commit: AMBARI-5689. In some cases automated agent setup doesn't work (dlysnichenko)

2014-05-10 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk e702b3175 - 00cc0cf50


AMBARI-5689. In some cases automated agent setup doesn't work (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 00cc0cf501564224489990d9a593caa67b9670c5
Parents: e702b31
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed May 7 16:41:22 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed May 7 16:41:22 2014 +0300

--
 .../main/python/common_functions/os_check.py|  41 +
 ambari-server/src/main/python/bootstrap.py  |   4 +-
 ambari-server/src/main/python/setupAgent.py | 109 +++---
 ambari-server/src/test/python/TestBootstrap.py  |   4 +-
 ambari-server/src/test/python/TestOSCheck.py|  27 
 ambari-server/src/test/python/TestSetupAgent.py | 149 ---
 6 files changed, 196 insertions(+), 138 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/00cc0cf5/ambari-common/src/main/python/common_functions/os_check.py
--
diff --git a/ambari-common/src/main/python/common_functions/os_check.py 
b/ambari-common/src/main/python/common_functions/os_check.py
index 1256a07..79aaa75 100644
--- a/ambari-common/src/main/python/common_functions/os_check.py
+++ b/ambari-common/src/main/python/common_functions/os_check.py
@@ -124,5 +124,46 @@ class OSCheck:
 else:
   raise Exception(Cannot detect os release name. Exiting...)
 
+  #  Exception safe family check functions
 
+  @staticmethod
+  def is_debian_family():
+
+ Return true if it is so or false if not
+
+ This is safe check for debian family, doesn't generate exception
+
+try:
+  if OSCheck.get_os_family() == debian:
+return True
+except Exception:
+  pass
+return False
+
+  @staticmethod
+  def is_suse_family():
+
+ Return true if it is so or false if not
 
+ This is safe check for suse family, doesn't generate exception
+
+try:
+  if OSCheck.get_os_family() == suse:
+return True
+except Exception:
+  pass
+return False
+
+  @staticmethod
+  def is_redhat_family():
+
+ Return true if it is so or false if not
+
+ This is safe check for redhat family, doesn't generate exception
+
+try:
+  if OSCheck.get_os_family() == redhat:
+return True
+except Exception:
+  pass
+return False

http://git-wip-us.apache.org/repos/asf/ambari/blob/00cc0cf5/ambari-server/src/main/python/bootstrap.py
--
diff --git a/ambari-server/src/main/python/bootstrap.py 
b/ambari-server/src/main/python/bootstrap.py
index 9e5ae1b..ac2ad66 100755
--- a/ambari-server/src/main/python/bootstrap.py
+++ b/ambari-server/src/main/python/bootstrap.py
@@ -417,9 +417,9 @@ class Bootstrap(threading.Thread):
 self.host_log.write(Checking 'sudo' package on remote host...)
 params = self.shared_state
 if self.getServerFamily()[0] == debian:
-  command = dpkg --get-selections|grep -e ^sudo
+  command = dpkg --get-selections|grep -e '^sudo\s*install'
 else:
-  command = rpm -qa | grep -e ^sudo
+  command = rpm -qa | grep -e '^sudo\-'
 ssh = SSH(params.user, params.sshkey_file, self.host, command,
   params.bootdir, self.host_log,
   errorMessage=Error: Sudo command is not available.  \

http://git-wip-us.apache.org/repos/asf/ambari/blob/00cc0cf5/ambari-server/src/main/python/setupAgent.py
--
diff --git a/ambari-server/src/main/python/setupAgent.py 
b/ambari-server/src/main/python/setupAgent.py
index 0c2851a..c7db372 100755
--- a/ambari-server/src/main/python/setupAgent.py
+++ b/ambari-server/src/main/python/setupAgent.py
@@ -29,6 +29,7 @@ import threading
 import traceback
 import stat
 from pprint import pformat
+from common_functions import OSCheck
 
 AMBARI_PASSPHRASE_VAR = AMBARI_PASSPHRASE
 
@@ -40,26 +41,12 @@ def execOsCommand(osCommand):
   return ret
 
 
-def is_suse():
-  if os.path.isfile(/etc/issue):
-if suse in open(/etc/issue).read().lower():
-  return True
-  return False
-
-
-def is_ubuntu():
-  if os.path.isfile(/etc/issue):
-if ubuntu in open(/etc/issue).read().lower():
-  return True
-  return False
-
-
 def installAgent(projectVersion):
Run install and make sure the agent install alright 
   # The command doesn't work with file mask ambari-agent*.rpm, so rename it on 
agent host
-  if is_suse():
+  if 

[2/2] git commit: AMBARI-5722. All Services Fail To Deploy Due To Agent Parsing Exception (dlysnichenko)

2014-05-12 Thread dmitriusan
AMBARI-5722. All Services Fail To Deploy Due To Agent Parsing Exception 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: c4bb5bcbf85ab643bfa263f4fc10af27a054b7cf
Parents: 5e49df1
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon May 12 13:36:33 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon May 12 17:58:03 2014 +0300

--
 .../python/ambari_agent/manifestGenerator.py|  4 ++
 .../ambari_agent/TestManifestGenerator.py   | 62 +++-
 .../apache/ambari/server/utils/StageUtils.java  | 22 ---
 .../ambari/server/utils/TestStageUtils.java | 16 +++--
 4 files changed, 60 insertions(+), 44 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/c4bb5bcb/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py 
b/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py
index 9b019be..66ce224 100644
--- a/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py
+++ b/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py
@@ -29,6 +29,7 @@ from ambari_agent import AgentException
 
 HOSTS_LIST_KEY = all_hosts
 PING_PORTS_KEY = all_ping_ports
+AMBARI_SERVER_HOST = ambari_server_host
 
 logger = logging.getLogger()
 
@@ -108,6 +109,7 @@ def decompressClusterHostInfo(clusterHostInfo):
   #Pop info not related to host roles  
   hostsList = info.pop(HOSTS_LIST_KEY)
   pingPorts = info.pop(PING_PORTS_KEY)
+  ambariServerHost = info.pop(AMBARI_SERVER_HOST)
 
   decompressedMap = {}
 
@@ -127,6 +129,8 @@ def decompressClusterHostInfo(clusterHostInfo):
   decompressedMap[PING_PORTS_KEY] = pingPorts
   #Add hosts list to result
   decompressedMap[HOSTS_LIST_KEY] = hostsList
+  #Add ambari-server host to result
+  decompressedMap[AMBARI_SERVER_HOST] = ambariServerHost
   
   return decompressedMap
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c4bb5bcb/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py 
b/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py
index a445b3c..b3163e2 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py
@@ -192,31 +192,39 @@ class TestManifestGenerator(TestCase):
   exceptionWasTrown = True
 self.assertTrue(exceptionWasTrown)
 
-def testDecompressClusterHostInfo(self):
-
-  info = { jtnode_host: [5],
-   hbase_master_hosts : [5],
-   all_hosts  : [h8, h9, h5, h4, h7, h6, 
h1, h3, h2, h10],
-   namenode_host  : [6],
-   mapred_tt_hosts: [0, 7-9, 2,3, 5],
-   slave_hosts: [3, 0, 1, 5-9],
-   snamenode_host : [8],
-   ping_ports : [8670:1,5-8, 8673:9, 8672:0,4, 
8671:2,3],
-   hbase_rs_hosts : [3, 1, 5, 8, 9]
-  }
-
-  decompressedInfo = 
manifestGenerator.decompressClusterHostInfo(clusterHostInfo)
-  
-  self.assertTrue(decompressedInfo.has_key(all_hosts))
-  
-  allHosts = decompressedInfo.pop(all_hosts)
-  
-  self.assertEquals(info.get(all_hosts), 
decompressedInfo.get(all_hosts))
-  
-  pingPorts = decompressedInfo.pop(all_ping_ports)
-  
-  self.assertEquals(pingPorts, 
manifestGenerator.convertMappedRangeToList(info.get(all_ping_ports)))
-  
-  for k,v in decompressedInfo.items():
-self.assertEquals(v, manifestGenerator.convertRangeToList(info.get(k)))
+  def testDecompressClusterHostInfo(self):
+
+all_hosts_key = all_hosts
+all_ping_ports_key = all_ping_ports
+ambari_server_host_key = ambari_server_host
+info = { jtnode_host: [5],
+ hbase_master_hosts : [5],
+ all_hosts_key: [h8, h9, h5, h4, h7, h6, h1, h3, 
h2, h10],
+ namenode_host  : [6],
+ mapred_tt_hosts: [0, 7-9, 2,3, 5],
+ slave_hosts: [3, 0, 1, 5-9],
+ snamenode_host : [8],
+ all_ping_ports_key: [8670:1,5-8, 8673:9, 8672:0,4, 
8671:2,3],
+ hbase_rs_hosts : [3, 1, 5, 8, 9],
+ ambari_server_host_key: [h0]
+}
+
+decompressedInfo = manifestGenerator.decompressClusterHostInfo(info)
+
+

[1/2] git commit: AMBARI-5722. All Services Fail To Deploy Due To Agent Parsing Exception (dlysnichenko)

2014-05-12 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-1.6.0 5eedb9838 - 6a29f0acb
  refs/heads/trunk 5e49df1a6 - c4bb5bcbf


AMBARI-5722. All Services Fail To Deploy Due To Agent Parsing Exception 
(dlysnichenko)


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

Branch: refs/heads/branch-1.6.0
Commit: 6a29f0acb532416ec8f0acc878e60a74848d53e5
Parents: 5eedb98
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon May 12 13:36:33 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon May 12 16:28:40 2014 +0300

--
 .../python/ambari_agent/manifestGenerator.py|  4 ++
 .../ambari_agent/TestManifestGenerator.py   | 62 +++-
 .../apache/ambari/server/utils/StageUtils.java  | 22 ---
 .../ambari/server/utils/TestStageUtils.java | 15 +++--
 4 files changed, 60 insertions(+), 43 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6a29f0ac/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py 
b/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py
index 9b019be..66ce224 100644
--- a/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py
+++ b/ambari-agent/src/main/python/ambari_agent/manifestGenerator.py
@@ -29,6 +29,7 @@ from ambari_agent import AgentException
 
 HOSTS_LIST_KEY = all_hosts
 PING_PORTS_KEY = all_ping_ports
+AMBARI_SERVER_HOST = ambari_server_host
 
 logger = logging.getLogger()
 
@@ -108,6 +109,7 @@ def decompressClusterHostInfo(clusterHostInfo):
   #Pop info not related to host roles  
   hostsList = info.pop(HOSTS_LIST_KEY)
   pingPorts = info.pop(PING_PORTS_KEY)
+  ambariServerHost = info.pop(AMBARI_SERVER_HOST)
 
   decompressedMap = {}
 
@@ -127,6 +129,8 @@ def decompressClusterHostInfo(clusterHostInfo):
   decompressedMap[PING_PORTS_KEY] = pingPorts
   #Add hosts list to result
   decompressedMap[HOSTS_LIST_KEY] = hostsList
+  #Add ambari-server host to result
+  decompressedMap[AMBARI_SERVER_HOST] = ambariServerHost
   
   return decompressedMap
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/6a29f0ac/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py 
b/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py
index a445b3c..b3163e2 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestManifestGenerator.py
@@ -192,31 +192,39 @@ class TestManifestGenerator(TestCase):
   exceptionWasTrown = True
 self.assertTrue(exceptionWasTrown)
 
-def testDecompressClusterHostInfo(self):
-
-  info = { jtnode_host: [5],
-   hbase_master_hosts : [5],
-   all_hosts  : [h8, h9, h5, h4, h7, h6, 
h1, h3, h2, h10],
-   namenode_host  : [6],
-   mapred_tt_hosts: [0, 7-9, 2,3, 5],
-   slave_hosts: [3, 0, 1, 5-9],
-   snamenode_host : [8],
-   ping_ports : [8670:1,5-8, 8673:9, 8672:0,4, 
8671:2,3],
-   hbase_rs_hosts : [3, 1, 5, 8, 9]
-  }
-
-  decompressedInfo = 
manifestGenerator.decompressClusterHostInfo(clusterHostInfo)
-  
-  self.assertTrue(decompressedInfo.has_key(all_hosts))
-  
-  allHosts = decompressedInfo.pop(all_hosts)
-  
-  self.assertEquals(info.get(all_hosts), 
decompressedInfo.get(all_hosts))
-  
-  pingPorts = decompressedInfo.pop(all_ping_ports)
-  
-  self.assertEquals(pingPorts, 
manifestGenerator.convertMappedRangeToList(info.get(all_ping_ports)))
-  
-  for k,v in decompressedInfo.items():
-self.assertEquals(v, manifestGenerator.convertRangeToList(info.get(k)))
+  def testDecompressClusterHostInfo(self):
+
+all_hosts_key = all_hosts
+all_ping_ports_key = all_ping_ports
+ambari_server_host_key = ambari_server_host
+info = { jtnode_host: [5],
+ hbase_master_hosts : [5],
+ all_hosts_key: [h8, h9, h5, h4, h7, h6, h1, h3, 
h2, h10],
+ namenode_host  : [6],
+ mapred_tt_hosts: [0, 7-9, 2,3, 5],
+ slave_hosts: [3, 0, 1, 5-9],
+ snamenode_host : [8],
+ all_ping_ports_key: [8670:1,5-8, 8673:9, 8672:0,4, 
8671:2,3],
+ hbase_rs_hosts : [3, 1, 5, 8, 9],
+

git commit: AMBARI-5632. tag exists problem when running config updates in sequence w/o a sleep (dlysnichenko)

2014-05-12 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 1d0fe34b6 - 55bb122d0


AMBARI-5632. tag exists problem when running config updates in sequence w/o a 
sleep (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 55bb122d0f03c5254f5df127656d70cb184f5441
Parents: 1d0fe34
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon May 12 20:57:24 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon May 12 20:57:24 2014 +0300

--
 ambari-server/src/main/resources/scripts/configs.sh | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/55bb122d/ambari-server/src/main/resources/scripts/configs.sh
--
diff --git a/ambari-server/src/main/resources/scripts/configs.sh 
b/ambari-server/src/main/resources/scripts/configs.sh
index a07ffb2..57fd2aa 100755
--- a/ambari-server/src/main/resources/scripts/configs.sh
+++ b/ambari-server/src/main/resources/scripts/configs.sh
@@ -138,8 +138,8 @@ doConfigUpdate () {
 newProperties=$newProperties$line
 propertiesStarted=0;
 
-newTag=`date +%s`
-newTag=version${newTag}000
+newTag=`date +%s%N`
+newTag=version${newTag}
 finalJson={ \Clusters\: { \desired_config\: {\type\: \$SITE\, 
\tag\:\$newTag\, $newProperties}}}
 newFile=doSet_$newTag.json
 echo ## PUTting json into: $newFile
@@ -164,8 +164,8 @@ doConfigFileUpdate () {
   FILENAME=$1
   if [ -f $FILENAME ]; then
 if [ 1 == `grep -n \\properties\\ $FILENAME | cut -d : -f 1` ]; 
then
-  newTag=`date +%s`
-  newTag=version${newTag}000
+  newTag=`date +%s%N`
+  newTag=version${newTag}
   newProperties=`cat $FILENAME`;
   finalJson={ \Clusters\: { \desired_config\: {\type\: \$SITE\, 
\tag\:\$newTag\, $newProperties}}}
   newFile=$FILENAME



git commit: AMBARI-5735. HDP deployment failed in CentOS5 (dlysnichenko)

2014-05-13 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 614db762f - 7e96b3c4c


AMBARI-5735. HDP deployment failed in CentOS5 (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 7e96b3c4c31281519c75b295f70049e3ca4cf10f
Parents: 614db76
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon May 12 21:14:46 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue May 13 21:05:13 2014 +0300

--
 .../scripts/shared_initialization.py| 10 +---
 .../scripts/shared_initialization.py| 10 +---
 .../1.3.2/services/HIVE/package/scripts/hive.py | 16 ++---
 .../NAGIOS/package/files/check_namenodes_ha.sh  |  3 ++-
 .../package/files/check_nodemanager_health.sh   |  3 ++-
 .../package/files/check_templeton_status.sh |  3 ++-
 .../NAGIOS/package/files/check_webui.sh |  3 ++-
 .../services/OOZIE/package/scripts/oozie.py |  9 +--
 .../WEBHCAT/package/files/templetonSmoke.sh |  7 +++---
 .../scripts/shared_initialization.py| 14 +++
 .../scripts/shared_initialization.py| 12 ++
 .../2.0.6/services/HIVE/package/scripts/hive.py | 25 ++--
 .../NAGIOS/package/files/check_namenodes_ha.sh  |  3 ++-
 .../package/files/check_nodemanager_health.sh   |  3 ++-
 .../package/files/check_templeton_status.sh |  3 ++-
 .../NAGIOS/package/files/check_webui.sh |  3 ++-
 .../services/OOZIE/package/scripts/oozie.py | 11 ++---
 .../WEBHCAT/package/files/templetonSmoke.sh |  7 +++---
 .../stacks/1.3.2/HIVE/test_hive_client.py   |  6 +++--
 .../stacks/1.3.2/HIVE/test_hive_metastore.py|  6 +++--
 .../stacks/1.3.2/HIVE/test_hive_server.py   |  6 +++--
 .../hooks/before-INSTALL/test_before_install.py |  6 +++--
 .../stacks/2.0.6/HIVE/test_hive_client.py   |  6 +++--
 .../stacks/2.0.6/HIVE/test_hive_metastore.py|  6 +++--
 .../stacks/2.0.6/HIVE/test_hive_server.py   |  6 +++--
 .../hooks/before-INSTALL/test_before_install.py |  6 +++--
 .../stacks/2.1/HIVE/test_hive_metastore.py  |  6 +++--
 27 files changed, 138 insertions(+), 61 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7e96b3c4/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
index c59d601..3a0bf93 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
@@ -150,11 +150,15 @@ def setup_java():
   if not params.jdk_name:
 return
 
+  environment = {
+no_proxy: format({ambari_server_hostname})
+  }
+
   Execute(format(mkdir -p {artifact_dir} ; curl -kf 
- --noproxy {ambari_server_hostname} 
  --retry 10 {jdk_location}/{jdk_name} -o {jdk_curl_target}),
   path = [/bin,/usr/bin/],
-  not_if = format(test -e {java_exec}))
+  not_if = format(test -e {java_exec}),
+  environment = environment)
 
   if params.jdk_name.endswith(.bin):
 install_cmd = format(mkdir -p {java_dir} ; chmod +x {jdk_curl_target}; cd 
{java_dir} ; echo A | {jdk_curl_target} -noregister  /dev/null 21)
@@ -169,12 +173,12 @@ def setup_java():
   if params.jce_policy_zip is not None:
 jce_curl_target = format({artifact_dir}/{jce_policy_zip})
 download_jce = format(mkdir -p {artifact_dir}; curl -kf 
-  --noproxy {ambari_server_hostname} 
   --retry 10 {jce_location}/{jce_policy_zip} 
   -o {jce_curl_target})
 Execute( download_jce,
  path = [/bin,/usr/bin/],
  not_if =format(test -e {jce_curl_target}),
+ environment = environment,
  ignore_failures = True
 )
   elif params.security_enabled:

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e96b3c4/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-START/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-START/scripts/shared_initialization.py
 

git commit: AMBARI-5757. Agent can not download modified stack files if wrong http_proxy is set up (dlysnichenko)

2014-05-14 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 17a4e3e9c - d1e53b326


AMBARI-5757. Agent can not download modified stack files if wrong http_proxy is 
set up (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: d1e53b326018e3e33173d150109b588c33437da2
Parents: 17a4e3e
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed May 14 18:46:10 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed May 14 18:46:10 2014 +0300

--
 ambari-agent/src/main/python/ambari_agent/FileCache.py | 6 --
 ambari-agent/src/main/python/ambari_agent/security.py  | 7 ++-
 ambari-agent/src/test/python/ambari_agent/TestFileCache.py | 4 ++--
 ambari-agent/src/test/python/ambari_agent/TestSecurity.py  | 6 +++---
 4 files changed, 15 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d1e53b32/ambari-agent/src/main/python/ambari_agent/FileCache.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/FileCache.py 
b/ambari-agent/src/main/python/ambari_agent/FileCache.py
index 740e820..91ec76a 100644
--- a/ambari-agent/src/main/python/ambari_agent/FileCache.py
+++ b/ambari-agent/src/main/python/ambari_agent/FileCache.py
@@ -155,7 +155,9 @@ class FileCache():
 logger.debug(Trying to download {0}.format(url))
 try:
   memory_buffer = StringIO.StringIO()
-  u = urllib2.urlopen(url, timeout=self.SOCKET_TIMEOUT)
+  proxy_handler = urllib2.ProxyHandler({})
+  opener = urllib2.build_opener(proxy_handler)
+  u = opener.open(url, timeout=self.SOCKET_TIMEOUT)
   logger.debug(Connected with {0} with code {1}.format(u.geturl(),
  u.getcode()))
   buff = u.read(self.BLOCK_SIZE)
@@ -234,4 +236,4 @@ class FileCache():
 except Exception, err:
   raise CachingException(Can not unpack zip file to 
  directory {0} : {1}.format(
-target_directory, str(err)))
\ No newline at end of file
+target_directory, str(err)))

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1e53b32/ambari-agent/src/main/python/ambari_agent/security.py
--
diff --git a/ambari-agent/src/main/python/ambari_agent/security.py 
b/ambari-agent/src/main/python/ambari_agent/security.py
index 9801dec..c4cb746 100644
--- a/ambari-agent/src/main/python/ambari_agent/security.py
+++ b/ambari-agent/src/main/python/ambari_agent/security.py
@@ -189,7 +189,9 @@ class CertificateManager():
   def loadSrvrCrt(self):
 get_ca_url = self.server_url + '/cert/ca/'
 logger.info(Downloading server cert from  + get_ca_url)
-stream = urllib2.urlopen(get_ca_url)
+proxy_handler = urllib2.ProxyHandler({})
+opener = urllib2.build_opener(proxy_handler)
+stream = opener.open(get_ca_url)
 response = stream.read()
 stream.close()
 srvr_crt_f = open(self.getSrvrCrtName(), 'w+')
@@ -204,6 +206,9 @@ class CertificateManager():
 register_data = {'csr'   : agent_crt_req_content,
 'passphrase' : passphrase}
 data = json.dumps(register_data)
+proxy_handler = urllib2.ProxyHandler({})
+opener = urllib2.build_opener(proxy_handler)
+urllib2.install_opener(opener)
 req = urllib2.Request(sign_crt_req_url, data, {'Content-Type': 
'application/json'})
 f = urllib2.urlopen(req)
 response = f.read()

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1e53b32/ambari-agent/src/test/python/ambari_agent/TestFileCache.py
--
diff --git a/ambari-agent/src/test/python/ambari_agent/TestFileCache.py 
b/ambari-agent/src/test/python/ambari_agent/TestFileCache.py
index 023d19a..63ecced 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestFileCache.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestFileCache.py
@@ -224,7 +224,7 @@ class TestFileCache(TestCase):
 'http://localhost:8080/resources//stacks/HDP/2.1.1/hooks/archive.zip')
 
 
-  @patch(urllib2.urlopen)
+  @patch(urllib2.OpenerDirector.open)
   def test_fetch_url(self, urlopen_mock):
 fileCache = FileCache(self.config)
 remote_url = http://dummy-url/;
@@ -367,4 +367,4 @@ class TestFileCache(TestCase):
 raise Exception(horrible_exc)
 
   def caching_exc_side_effect(self, *a):
-raise CachingException(horrible_caching_exc)
\ No newline at end of file
+raise 

[1/2] AMBARI-5580. Introduce operation_level request parameter (dlysnichenko)

2014-05-15 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 2fb2a17ec - 5dff4516a


http://git-wip-us.apache.org/repos/asf/ambari/blob/5dff4516/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestOperationLevelTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestOperationLevelTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestOperationLevelTest.java
new file mode 100644
index 000..d832015
--- /dev/null
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestOperationLevelTest.java
@@ -0,0 +1,58 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.controller.internal;
+
+import junit.framework.TestCase;
+import org.junit.Test;
+import static junit.framework.TestCase.*;
+
+public class RequestOperationLevelTest {
+
+  private final String host_component = HOST_COMPONENT;
+  private final String hostComponent = HostComponent;
+
+  @Test
+  public void testGetInternalLevelName() throws Exception {
+String internal = 
RequestOperationLevel.getInternalLevelName(host_component);
+assertEquals(internal, hostComponent);
+// Check case-insensitivity
+internal = 
RequestOperationLevel.getInternalLevelName(host_component.toLowerCase());
+assertEquals(internal, hostComponent);
+// Check wrong param
+try {
+  RequestOperationLevel.getInternalLevelName(Wrong_param);
+  fail(Should throw exception);
+} catch (IllegalArgumentException e) {
+  // expected
+}
+  }
+
+  @Test
+  public void testGetExternalLevelName() throws Exception {
+String external = 
RequestOperationLevel.getExternalLevelName(hostComponent);
+assertEquals(external, host_component);
+// Check wrong param
+try {
+  RequestOperationLevel.getExternalLevelName(Wrong_param);
+  fail(Should throw exception);
+} catch (IllegalArgumentException e) {
+  // expected
+}
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/5dff4516/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
index c0ad8ce..2312383 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/RequestResourceProviderTest.java
@@ -30,7 +30,10 @@ import 
org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
 import org.apache.ambari.server.controller.spi.Predicate;
 import org.apache.ambari.server.controller.spi.Request;
 import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException;
 import org.apache.ambari.server.controller.spi.ResourceProvider;
+import org.apache.ambari.server.controller.spi.SystemException;
+import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
 import org.apache.ambari.server.controller.utilities.PredicateBuilder;
 import org.apache.ambari.server.controller.utilities.PropertyHelper;
 import org.apache.ambari.server.state.Cluster;
@@ -914,8 +917,8 @@ public class RequestResourceProviderTest {
 
 MapString, String requestInfoProperties = new HashMapString, String();
 
-requestInfoProperties.put(/parameters/param1, value1);
-requestInfoProperties.put(/parameters/param2, value2);
+requestInfoProperties.put(parameters/param1, value1);
+requestInfoProperties.put(parameters/param2, value2);
 
 String[] expectedHosts = new String[]{host1, host2, host3};
 MapString, String expectedParams = new HashMapString, String() {{
@@ -965,4 +968,99 @@ public class RequestResourceProviderTest {
   Assert.assertEquals(expectedParams.get(key), 

git commit: AMBARI-5832. service_name field unavailable from Hosts API (dlysnichenko)

2014-05-20 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 836691a65 - 2bd7b1a09


AMBARI-5832. service_name field unavailable from Hosts API (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 2bd7b1a09d2d4c5444fa344c2091370cd6258ddb
Parents: 836691a
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue May 20 20:34:20 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue May 20 20:35:51 2014 +0300

--
 ambari-server/src/main/resources/properties.json   | 1 +
 .../controller/internal/HostComponentResourceProviderTest.java | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/2bd7b1a0/ambari-server/src/main/resources/properties.json
--
diff --git a/ambari-server/src/main/resources/properties.json 
b/ambari-server/src/main/resources/properties.json
index 3d2a036..0cb32e7 100644
--- a/ambari-server/src/main/resources/properties.json
+++ b/ambari-server/src/main/resources/properties.json
@@ -72,6 +72,7 @@
 HostRoles/stale_configs,
 HostRoles/desired_admin_state,
 HostRoles/maintenance_state,
+HostRoles/service_name,
 _
 ],
 Configuration:[

http://git-wip-us.apache.org/repos/asf/ambari/blob/2bd7b1a0/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
index bd31b7e..08a72bb 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostComponentResourceProviderTest.java
@@ -254,7 +254,7 @@ public class HostComponentResourceProviderTest {
 
EasyMock.SetServiceComponentHostRequestanyObject())).andReturn(nameResponse).once();
 expect(managementController.updateHostComponents(
 AbstractResourceProviderTest.Matcher.getHostComponentRequestSet(
-Cluster102, null, Component100, Host100, null, STARTED),
+Cluster102, Service100, Component100, Host100, null, 
STARTED),
 eq(mapRequestProps), eq(false))).andReturn(response).once();
 
 
expect(resourceProviderFactory.getHostComponentResourceProvider(anyObject(Set.class),



git commit: AMBARI-5895. Suppress any debug and info messages from package managers in setupAgent.py (dlysnichenko)

2014-05-26 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk bed137b78 - fe12ebc04


AMBARI-5895. Suppress any debug and info messages from package managers in 
setupAgent.py (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: fe12ebc04b849b8340b9bd46ced0ac0aca579114
Parents: bed137b
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon May 26 17:23:31 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon May 26 17:24:14 2014 +0300

--
 ambari-server/src/main/python/setupAgent.py | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/fe12ebc0/ambari-server/src/main/python/setupAgent.py
--
diff --git a/ambari-server/src/main/python/setupAgent.py 
b/ambari-server/src/main/python/setupAgent.py
index c7db372..28651e7 100755
--- a/ambari-server/src/main/python/setupAgent.py
+++ b/ambari-server/src/main/python/setupAgent.py
@@ -104,16 +104,16 @@ def findNearestAgentPackageVersion(projectVersion):
   if projectVersion == :
 projectVersion =   
   if OSCheck.is_suse_family():
-Command = [bash, -c, zypper search -s --match-exact ambari-agent | 
grep ' + projectVersion +
+Command = [bash, -c, zypper -q search -s --match-exact ambari-agent | 
grep ' + projectVersion +
  ' | cut -d '|' -f 4 | head -n1 | sed -e 
's/-\w[^:]*//1' ]
   elif OSCheck.is_debian_family():
 if projectVersion ==   :
-  Command = [bash, -c, apt-cache show ambari-agent |grep 
'Version\:'|cut -d ' ' -f 2|tr -d '\\n'|sed -s 's/[-|~][A-Za-z\d]*//']
+  Command = [bash, -c, apt-cache -q show ambari-agent |grep 
'Version\:'|cut -d ' ' -f 2|tr -d '\\n'|sed -s 's/[-|~][A-Za-z0-9]*//']
 else:
-  Command = [bash, -c, apt-cache show ambari-agent |grep 
'Version\:'|cut -d ' ' -f 2|grep ' +
+  Command = [bash, -c, apt-cache -q show ambari-agent |grep 
'Version\:'|cut -d ' ' -f 2|grep ' +
projectVersion + '|tr -d '\\n'|sed -s 's/[-|~][A-Za-z\d]*//']
   else:
-Command = [bash, -c, yum list all ambari-agent | grep ' + 
projectVersion +
+Command = [bash, -c, yum -q list all ambari-agent | grep ' + 
projectVersion +
   ' | sed -re 's/\s+/ /g' | cut -d ' ' -f 2 | 
head -n1 | sed -e 's/-\w[^:]*//1' ]
   return execOsCommand(Command)
 
@@ -133,13 +133,13 @@ def isAgentPackageAlreadyInstalled(projectVersion):
 def getAvaliableAgentPackageVersions():
   if OSCheck.is_suse_family():
 Command = [bash, -c,
-zypper search -s --match-exact ambari-agent | grep ambari-agent | sed 
-re 's/\s+/ /g' | cut -d '|' -f 4 | tr '\\n' ', ' | sed -s 
's/[-|~][A-Za-z\d]*//g']
+zypper -q search -s --match-exact ambari-agent | grep ambari-agent | 
sed -re 's/\s+/ /g' | cut -d '|' -f 4 | tr '\\n' ', ' | sed -s 
's/[-|~][A-Za-z0-9]*//g']
   elif OSCheck.is_debian_family():
 Command = [bash, -c,
-apt-cache show ambari-agent|grep 'Version\:'|cut -d ' ' -f 2| tr 
'\\n' ', '|sed -s 's/[-|~][A-Za-z\d]*//g']
+apt-cache -q show ambari-agent|grep 'Version\:'|cut -d ' ' -f 2| tr 
'\\n' ', '|sed -s 's/[-|~][A-Za-z0-9]*//g']
   else:
 Command = [bash, -c,
-yum list all ambari-agent | grep -E '^ambari-agent' | sed -re 's/\s+/ 
/g' | cut -d ' ' -f 2 | tr '\\n' ', ' | sed -s 's/[-|~][A-Za-z\d]*//g']
+yum -q list all ambari-agent | grep -E '^ambari-agent' | sed -re 
's/\s+/ /g' | cut -d ' ' -f 2 | tr '\\n' ', ' | sed -s 
's/[-|~][A-Za-z0-9]*//g']
   return execOsCommand(Command)
 
 
@@ -152,8 +152,8 @@ def checkServerReachability(host, port):
   except Exception:
ret[exitstatus] = 1
ret[log] = Host registration aborted. Ambari Agent host cannot reach 
Ambari Server ' +\
-host+:+str(port) + '. +\
-   Please check the network connectivity between the 
Ambari Agent host and the Ambari Server
+host+:+str(port) + '.  +\
+Please check the network connectivity between the Ambari 
Agent host and the Ambari Server
sys.exit(ret)
   pass
 



git commit: AMBARI-5957. Bootstrap API call says bootstrap is running even though all agents have installed and registered (dlysnichenko)

2014-05-30 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk 1b0387953 - 7360a79b7


AMBARI-5957. Bootstrap API call says bootstrap is running even though all 
agents have installed and registered (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 7360a79b7add328d6befdebabe0a9d7009ac02ef
Parents: 1b03879
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri May 30 18:26:21 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri May 30 18:27:08 2014 +0300

--
 ambari-server/src/main/python/setupAgent.py | 26 
 ambari-server/src/test/python/TestSetupAgent.py |  8 +-
 2 files changed, 17 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7360a79b/ambari-server/src/main/python/setupAgent.py
--
diff --git a/ambari-server/src/main/python/setupAgent.py 
b/ambari-server/src/main/python/setupAgent.py
index 28651e7..17a1552 100755
--- a/ambari-server/src/main/python/setupAgent.py
+++ b/ambari-server/src/main/python/setupAgent.py
@@ -66,23 +66,17 @@ def runAgent(passPhrase, expected_hostname):
   os.environ[AMBARI_PASSPHRASE_VAR] = passPhrase
   agent_retcode = subprocess.call(/usr/sbin/ambari-agent restart 
--expected-hostname= +
   expected_hostname, shell=True)
-  # need this, because, very rarely,
-  # main.py(ambari-agent) starts a bit later then it should be started
-  time.sleep(1)
-  try:
+  for i in range(3):
+time.sleep(1)
 ret = execOsCommand([tail, -20, 
/var/log/ambari-agent/ambari-agent.log])
-try:
-  log = ret['log']
-except Exception:
-  log = Log not found
-print log
-if not 0 == ret['exitstatus']:
-  return ret['exitstatus']
-
-return agent_retcode
-  except (Exception):
-return 1
-
+if (not ret is None) and (0 == ret['exitstatus']):
+  try:
+log = ret['log']
+  except Exception:
+log = Log not found
+  print log
+  return agent_retcode
+  return agent_retcode
 
 def getOptimalVersion(initialProjectVersion):
   optimalVersion = initialProjectVersion

http://git-wip-us.apache.org/repos/asf/ambari/blob/7360a79b/ambari-server/src/test/python/TestSetupAgent.py
--
diff --git a/ambari-server/src/test/python/TestSetupAgent.py 
b/ambari-server/src/test/python/TestSetupAgent.py
index 508ae3f..0f5f5b7 100644
--- a/ambari-server/src/test/python/TestSetupAgent.py
+++ b/ambari-server/src/test/python/TestSetupAgent.py
@@ -67,18 +67,24 @@ class TestSetupAgent(TestCase):
 self.assertTrue(expected_hostname in cmdStr)
 self.assertEqual(ret, 0)
 self.assertTrue(sleep_mock.called)
+self.assertEqual(execOsCommand_mock.call_count, 1)
+execOsCommand_mock.reset_mock()
 # Key 'log' not found
 execOsCommand_mock.return_value = None
 ret = setup_agent.runAgent(passphrase, expected_hostname)
 cmdStr = str(call_mock.call_args_list[0][0])
 self.assertTrue(expected_hostname in cmdStr)
-self.assertEqual(ret, 1)
+self.assertEqual(ret, 0)
+self.assertEqual(execOsCommand_mock.call_count, 3)
+execOsCommand_mock.reset_mock()
 # Retcode id not 0
+call_mock.return_value = 2
 execOsCommand_mock.return_value = {'log': 'log', 'exitstatus': 2}
 ret = setup_agent.runAgent(passphrase, expected_hostname)
 cmdStr = str(call_mock.call_args_list[0][0])
 self.assertTrue(expected_hostname in cmdStr)
 self.assertEqual(ret, 2)
+execOsCommand_mock.reset_mock()
 
   @patch.object(setup_agent, 'getAvaliableAgentPackageVersions')
   @patch('common_functions.OSCheck.is_suse_family')



git commit: AMBARI-5990. Nagios templates for 1.x and 2.x stacks contain irrelevant services (dlysnichenko)

2014-06-02 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk f38b5b8ac - 46fdf5cd2


AMBARI-5990. Nagios templates for 1.x and 2.x stacks contain irrelevant 
services (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 46fdf5cd25ed81525ac4fa1dbc857698b4cff2ba
Parents: f38b5b8
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Jun 2 19:35:10 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Jun 2 19:35:59 2014 +0300

--
 .../services/NAGIOS/package/scripts/params.py   |   6 -
 .../templates/hadoop-servicegroups.cfg.j2   |  10 +-
 .../package/templates/hadoop-services.cfg.j2| 153 ---
 .../services/NAGIOS/package/scripts/params.py   |   2 -
 .../package/templates/hadoop-services.cfg.j2|  22 +--
 5 files changed, 4 insertions(+), 189 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/46fdf5cd/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
index 5df2767..806aefe 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py
@@ -56,8 +56,6 @@ namenode_port = 
get_port_from_url(config['configurations']['hdfs-site']['dfs.htt
 snamenode_port = 
get_port_from_url(config['configurations']['hdfs-site'][dfs.secondary.http.address])
 
 hbase_master_rpc_port = 6
-rm_port = 
get_port_from_url(config['configurations']['yarn-site']['yarn.resourcemanager.webapp.address'])
-nm_port = 8042
 hs_port = 
get_port_from_url(config['configurations']['mapred-site']['mapreduce.history.server.http.address'])
 journalnode_port = 
get_port_from_url(config['configurations']['hdfs-site']['dfs.journalnode.http-address'])
 datanode_port = 
get_port_from_url(config['configurations']['hdfs-site']['dfs.datanode.http.address'])
@@ -121,8 +119,6 @@ _slave_hosts = default(/clusterHostInfo/slave_hosts, None)
 _tt_hosts = default(/clusterHostInfo/mapred_tt_hosts, [])
 _journalnode_hosts = default(/clusterHostInfo/journalnode_hosts, None)
 _zkfc_hosts = default(/clusterHostInfo/zkfc_hosts, None)
-_rm_host = default(/clusterHostInfo/rm_host, None)
-_nm_hosts = default(/clusterHostInfo/nm_hosts, None)
 _hs_host = default(/clusterHostInfo/hs_host, None)
 _zookeeper_hosts = default(/clusterHostInfo/zookeeper_hosts, None)
 _flume_hosts = default(/clusterHostInfo/flume_hosts, None)
@@ -159,8 +155,6 @@ hostgroup_defs = {
 'oozie-server' : _oozie_server,
 'webhcat-server' : _webhcat_server_host,
 'hue-server' : _hue_server_host,
-'resourcemanager' : _rm_host,
-'nodemanagers' : _nm_hosts,
 'historyserver2' : _hs_host,
 'jobhistory': _hs_host,
 'journalnodes' : _journalnode_hosts

http://git-wip-us.apache.org/repos/asf/ambari/blob/46fdf5cd/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-servicegroups.cfg.j2
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-servicegroups.cfg.j2
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-servicegroups.cfg.j2
index 74e6e48..c8f2d87 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-servicegroups.cfg.j2
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-servicegroups.cfg.j2
@@ -50,13 +50,7 @@ define servicegroup {
   alias  MAPREDUCE Checks
 }
 {% endif %}
-{%if hostgroup_defs['resourcemanager'] or
-  hostgroup_defs['nodemanagers'] %}
-define servicegroup {
-  servicegroup_name  YARN
-  alias  YARN Checks
-}
-{% endif %}
+
 {%if hostgroup_defs['flume-servers'] %}
 define servicegroup {
   servicegroup_name  FLUME
@@ -114,4 +108,4 @@ define servicegroup {
   servicegroup_name  HUE
   alias  HUE Checks
 }
-{% endif %}
\ No newline at end of file
+{% endif %}

http://git-wip-us.apache.org/repos/asf/ambari/blob/46fdf5cd/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-services.cfg.j2
--
diff --git 

[2/2] git commit: AMBARI-6227. Hcatalog service check failed on start all services call (dlysnichenko)

2014-06-20 Thread dmitriusan
AMBARI-6227. Hcatalog service check failed on start all services call 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 7e5988c4b200a4111afc4e37cebfc9bef5710aa6
Parents: 49028c7
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Jun 20 22:09:34 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Jun 20 22:09:34 2014 +0300

--
 .../stacks/HDP/1.3.2/services/HIVE/metainfo.xml  |  1 +
 .../1.3.2/services/HIVE/package/scripts/hcat.py  |  7 +++
 .../stacks/HDP/2.0.6/services/HIVE/metainfo.xml  |  1 +
 .../2.0.6/services/HIVE/package/scripts/hcat.py  |  7 +++
 .../python/stacks/1.3.2/HIVE/test_hcat_client.py | 19 ++-
 .../python/stacks/2.0.6/HIVE/test_hcat_client.py | 15 +++
 6 files changed, 49 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7e5988c4/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
index df28384..7c929b3 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
@@ -166,6 +166,7 @@
 
   configuration-dependencies
 config-typeglobal/config-type
+config-typehive-site/config-type
   /configuration-dependencies
 
 /service

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e5988c4/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hcat.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hcat.py
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hcat.py
index 2993d3a..c25f530 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hcat.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hcat.py
@@ -35,6 +35,13 @@ def hcat():
 recursive=True
   )
 
+  XmlConfig(hive-site.xml,
+conf_dir=params.hive_conf_dir,
+configurations=params.config['configurations']['hive-site'],
+owner=params.hive_user,
+group=params.user_group,
+mode=0644)
+
   hcat_TemplateConfig('hcat-env.sh')
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e5988c4/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
index 8a05620..5b927ca 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
@@ -183,6 +183,7 @@
   /commandScript
   configuration-dependencies
 config-typeglobal/config-type
+config-typehive-site/config-type
   /configuration-dependencies
 /service
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e5988c4/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hcat.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hcat.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hcat.py
index 2993d3a..c25f530 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hcat.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hcat.py
@@ -35,6 +35,13 @@ def hcat():
 recursive=True
   )
 
+  XmlConfig(hive-site.xml,
+conf_dir=params.hive_conf_dir,
+configurations=params.config['configurations']['hive-site'],
+owner=params.hive_user,
+group=params.user_group,
+mode=0644)
+
   hcat_TemplateConfig('hcat-env.sh')
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e5988c4/ambari-server/src/test/python/stacks/1.3.2/HIVE/test_hcat_client.py
--
diff --git 

[1/2] git commit: AMBARI-6227. Hcatalog service check failed on start all services call (dlysnichenko)

2014-06-20 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-1.6.1 a95598b6f - 8a4be2d04
  refs/heads/trunk 49028c7f9 - 7e5988c4b


AMBARI-6227. Hcatalog service check failed on start all services call 
(dlysnichenko)


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

Branch: refs/heads/branch-1.6.1
Commit: 8a4be2d04179b94129961dc3215aaaddfde08a28
Parents: a95598b
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Jun 20 22:06:47 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Jun 20 22:06:47 2014 +0300

--
 .../stacks/HDP/1.3.2/services/HIVE/metainfo.xml  |  1 +
 .../1.3.2/services/HIVE/package/scripts/hcat.py  |  7 +++
 .../stacks/HDP/2.0.6/services/HIVE/metainfo.xml  |  1 +
 .../2.0.6/services/HIVE/package/scripts/hcat.py  |  7 +++
 .../python/stacks/1.3.2/HIVE/test_hcat_client.py | 19 ++-
 .../python/stacks/2.0.6/HIVE/test_hcat_client.py | 15 +++
 6 files changed, 49 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8a4be2d0/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
index df28384..7c929b3 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/metainfo.xml
@@ -166,6 +166,7 @@
 
   configuration-dependencies
 config-typeglobal/config-type
+config-typehive-site/config-type
   /configuration-dependencies
 
 /service

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a4be2d0/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hcat.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hcat.py
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hcat.py
index 2993d3a..c25f530 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hcat.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HIVE/package/scripts/hcat.py
@@ -35,6 +35,13 @@ def hcat():
 recursive=True
   )
 
+  XmlConfig(hive-site.xml,
+conf_dir=params.hive_conf_dir,
+configurations=params.config['configurations']['hive-site'],
+owner=params.hive_user,
+group=params.user_group,
+mode=0644)
+
   hcat_TemplateConfig('hcat-env.sh')
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a4be2d0/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
index 8a05620..5b927ca 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/metainfo.xml
@@ -183,6 +183,7 @@
   /commandScript
   configuration-dependencies
 config-typeglobal/config-type
+config-typehive-site/config-type
   /configuration-dependencies
 /service
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8a4be2d0/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hcat.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hcat.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hcat.py
index 2993d3a..c25f530 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hcat.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HIVE/package/scripts/hcat.py
@@ -35,6 +35,13 @@ def hcat():
 recursive=True
   )
 
+  XmlConfig(hive-site.xml,
+conf_dir=params.hive_conf_dir,
+configurations=params.config['configurations']['hive-site'],
+owner=params.hive_user,
+group=params.user_group,
+mode=0644)
+
   hcat_TemplateConfig('hcat-env.sh')
 
 


[2/4] git commit: AMBARI-6226. ambari-agent start command fails. (dlysnichenko)

2014-06-23 Thread dmitriusan
AMBARI-6226. ambari-agent start command fails. (dlysnichenko)


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

Branch: refs/heads/branch-1.6.1
Commit: aaddd0608f311df09eff7808df71e8fc3eecac3d
Parents: a878293
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Jun 23 16:10:20 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Jun 23 16:10:20 2014 +0300

--
 ambari-server/src/main/python/setupAgent.py | 7 ++-
 ambari-server/src/test/python/TestSetupAgent.py | 4 +++-
 2 files changed, 9 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/aaddd060/ambari-server/src/main/python/setupAgent.py
--
diff --git a/ambari-server/src/main/python/setupAgent.py 
b/ambari-server/src/main/python/setupAgent.py
index 6edbdc4..1fad46a 100755
--- a/ambari-server/src/main/python/setupAgent.py
+++ b/ambari-server/src/main/python/setupAgent.py
@@ -78,6 +78,9 @@ def runAgent(passPhrase, expected_hostname):
   return agent_retcode
   return agent_retcode
 
+def tryStopAgent():
+  subprocess.call(/usr/sbin/ambari-agent stop, shell=True)
+
 def getOptimalVersion(initialProjectVersion):
   optimalVersion = initialProjectVersion
   ret = findNearestAgentPackageVersion(optimalVersion)
@@ -197,7 +200,9 @@ def main(argv=None):
 retcode = getOptimalVersion()
   else:
 retcode = getOptimalVersion(projectVersion)
-
+  
+  tryStopAgent()
+  
   if retcode[exitstatus] == 0 and retcode[log] != None and retcode[log] 
!=  and retcode[log][0].strip() != :
   availiableProjectVersion = retcode[log].strip()
   if not isAgentPackageAlreadyInstalled(availiableProjectVersion):

http://git-wip-us.apache.org/repos/asf/ambari/blob/aaddd060/ambari-server/src/test/python/TestSetupAgent.py
--
diff --git a/ambari-server/src/test/python/TestSetupAgent.py 
b/ambari-server/src/test/python/TestSetupAgent.py
index c6f8466..1bbe62e 100644
--- a/ambari-server/src/test/python/TestSetupAgent.py
+++ b/ambari-server/src/test/python/TestSetupAgent.py
@@ -202,6 +202,7 @@ class TestSetupAgent(TestCase):
   def test_execOsCommand(self, Popen_mock):
 self.assertFalse(setup_agent.execOsCommand(hostname -f) == None)
 
+  @patch.object(setup_agent, 'tryStopAgent')
   @patch.object(setup_agent, 'isAgentPackageAlreadyInstalled')
   @patch.object(setup_agent, 'runAgent')
   @patch.object(setup_agent, 'configureAgent')
@@ -216,11 +217,12 @@ class TestSetupAgent(TestCase):
   def test_setup_agent_main(self, dirname_mock, realpath_mock, exit_mock, 
checkServerReachability_mock,
 getOptimalVersion_mock, is_debian_family_mock, 
is_suse_family_mock,
 installAgent_mock, configureAgent_mock, 
runAgent_mock,
-isAgentPackageAlreadyInstalled_mock):
+isAgentPackageAlreadyInstalled_mock, 
tryStopAgent_mock):
 installAgent_mock.return_value = {'log': 'log', 'exitstatus': 0}
 runAgent_mock.return_value = 0
 getOptimalVersion_mock.return_value = {'log': '1.1.2, 1.1.3, ', 
'exitstatus': 1}
 setup_agent.main((setupAgent.py,agents_host,password, 
server_hostname,1.1.1,8080))
+self.assertTrue(tryStopAgent_mock.called)
 self.assertTrue(exit_mock.called)
 self.assertTrue(getOptimalVersion_mock.called)
 exit_mock.reset_mock()



[3/4] git commit: AMBARI-6234. Security issue - private key password show in logs (dlysnichenko)

2014-06-23 Thread dmitriusan
AMBARI-6234. Security issue - private key password show in logs (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 7888bbf21a6c867131d138a08f680b458bc1056c
Parents: ce815fb
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Jun 23 14:52:05 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Jun 23 16:13:29 2014 +0300

--
 .../org/apache/ambari/server/utils/ShellCommandUtil.java | 11 +--
 .../apache/ambari/server/utils/TestShellCommandUtil.java | 10 +++---
 2 files changed, 16 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7888bbf2/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
index 7e447f9..ee83aa0 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
@@ -32,7 +32,7 @@ public class ShellCommandUtil {
   private static final Log LOG = LogFactory.getLog(ShellCommandUtil.class);
   private static final Object WindowsProcessLaunchLock = new Object();
   private static final String PASS_TOKEN = pass:;
-
+  private static final String KEY_TOKEN = -key ;
   /*
   public static String LogAndReturnOpenSslExitCode(String command, int 
exitCode) {
 logOpenSslExitCode(command, exitCode);
@@ -49,7 +49,14 @@ public class ShellCommandUtil {
   }
 
   public static String hideOpenSslPassword(String command){
-int start = command.indexOf(PASS_TOKEN)+PASS_TOKEN.length();
+int start;
+if(command.contains(PASS_TOKEN)){
+  start = command.indexOf(PASS_TOKEN)+PASS_TOKEN.length();
+} else if (command.contains(KEY_TOKEN)){
+  start = command.indexOf(KEY_TOKEN)+KEY_TOKEN.length();
+} else {
+  return command;
+}
 CharSequence cs = command.subSequence(start, command.indexOf( , start));
 return command.replace(cs, );
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7888bbf2/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
index 32a25ad..27a033c 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
@@ -133,10 +133,14 @@ public class TestShellCommandUtil extends TestCase {
   
   @Test
   public void testHideOpenSslPassword(){
-String command = openssl ca -config ca.config -in agent_hostname1.csr 
-out +
+String command_pass = openssl ca -config ca.config -in 
agent_hostname1.csr -out +
 agent_hostname1.crt -batch -passin pass:1234 -keyfile ca.key 
-cert ca.crt;
-
-
assertFalse(ShellCommandUtil.hideOpenSslPassword(command).contains(1234));
+String command_key = openssl ca -create_serial -out 
/var/lib/ambari-server/keys/ca.crt -days 365 -keyfile 
/var/lib/ambari-server/keys/ca.key  +
+-key 1234 -selfsign -extensions jdk7_ca  +
+-config /var/lib/ambari-server/keys/ca.config -batch  +
+-infiles /var/lib/ambari-server/keys/ca.csr;
+
assertFalse(ShellCommandUtil.hideOpenSslPassword(command_pass).contains(1234));
+
assertFalse(ShellCommandUtil.hideOpenSslPassword(command_key).contains(1234));
   }
   
 }



[1/4] git commit: AMBARI-6234. Security issue - private key password show in logs (dlysnichenko)

2014-06-23 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-1.6.1 4b7d557f5 - aaddd0608
  refs/heads/trunk ce815fbd5 - 2c6c0492f


AMBARI-6234. Security issue - private key password show in logs (dlysnichenko)


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

Branch: refs/heads/branch-1.6.1
Commit: a8782931e99c06385594e99bc2f9e765c383ef80
Parents: 4b7d557
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Mon Jun 23 14:52:05 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Mon Jun 23 16:06:09 2014 +0300

--
 .../org/apache/ambari/server/utils/ShellCommandUtil.java | 11 +--
 .../apache/ambari/server/utils/TestShellCommandUtil.java | 10 +++---
 2 files changed, 16 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a8782931/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
index 7e447f9..ee83aa0 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/utils/ShellCommandUtil.java
@@ -32,7 +32,7 @@ public class ShellCommandUtil {
   private static final Log LOG = LogFactory.getLog(ShellCommandUtil.class);
   private static final Object WindowsProcessLaunchLock = new Object();
   private static final String PASS_TOKEN = pass:;
-
+  private static final String KEY_TOKEN = -key ;
   /*
   public static String LogAndReturnOpenSslExitCode(String command, int 
exitCode) {
 logOpenSslExitCode(command, exitCode);
@@ -49,7 +49,14 @@ public class ShellCommandUtil {
   }
 
   public static String hideOpenSslPassword(String command){
-int start = command.indexOf(PASS_TOKEN)+PASS_TOKEN.length();
+int start;
+if(command.contains(PASS_TOKEN)){
+  start = command.indexOf(PASS_TOKEN)+PASS_TOKEN.length();
+} else if (command.contains(KEY_TOKEN)){
+  start = command.indexOf(KEY_TOKEN)+KEY_TOKEN.length();
+} else {
+  return command;
+}
 CharSequence cs = command.subSequence(start, command.indexOf( , start));
 return command.replace(cs, );
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/a8782931/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
index 32a25ad..27a033c 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/utils/TestShellCommandUtil.java
@@ -133,10 +133,14 @@ public class TestShellCommandUtil extends TestCase {
   
   @Test
   public void testHideOpenSslPassword(){
-String command = openssl ca -config ca.config -in agent_hostname1.csr 
-out +
+String command_pass = openssl ca -config ca.config -in 
agent_hostname1.csr -out +
 agent_hostname1.crt -batch -passin pass:1234 -keyfile ca.key 
-cert ca.crt;
-
-
assertFalse(ShellCommandUtil.hideOpenSslPassword(command).contains(1234));
+String command_key = openssl ca -create_serial -out 
/var/lib/ambari-server/keys/ca.crt -days 365 -keyfile 
/var/lib/ambari-server/keys/ca.key  +
+-key 1234 -selfsign -extensions jdk7_ca  +
+-config /var/lib/ambari-server/keys/ca.config -batch  +
+-infiles /var/lib/ambari-server/keys/ca.csr;
+
assertFalse(ShellCommandUtil.hideOpenSslPassword(command_pass).contains(1234));
+
assertFalse(ShellCommandUtil.hideOpenSslPassword(command_key).contains(1234));
   }
   
 }



git commit: AMBARI-6253. Disable check_service_freshness at our Nagios config (dlysnichenko)

2014-06-24 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk dd8b03cf0 - 7030788e3


AMBARI-6253. Disable check_service_freshness at our Nagios config (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 7030788e3fafbd06b1cf160c18958877850223bb
Parents: dd8b03c
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Jun 24 16:43:23 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Jun 24 16:43:23 2014 +0300

--
 .../HDP/1.3.2/services/NAGIOS/package/templates/nagios.cfg.j2  | 2 +-
 .../HDP/2.0.6/services/NAGIOS/package/templates/nagios.cfg.j2  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7030788e/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/nagios.cfg.j2
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/nagios.cfg.j2
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/nagios.cfg.j2
index 05d94b5..aa37a01 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/nagios.cfg.j2
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/nagios.cfg.j2
@@ -1048,7 +1048,7 @@ check_for_orphaned_hosts=1
 # manner.
 # Values: 1 = enabled freshness checking, 0 = disable freshness checking
 
-check_service_freshness=1
+check_service_freshness=0
 
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7030788e/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/nagios.cfg.j2
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/nagios.cfg.j2
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/nagios.cfg.j2
index 528ddc2..d51471b 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/nagios.cfg.j2
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/nagios.cfg.j2
@@ -1045,7 +1045,7 @@ check_for_orphaned_hosts=1
 # manner.
 # Values: 1 = enabled freshness checking, 0 = disable freshness checking
 
-check_service_freshness=1
+check_service_freshness=0
 
 
 



[2/2] git commit: AMBARI-6288. ambari-server may kill INIT and SSHD process (in some specific scenarios) (dlysnichenko)

2014-06-26 Thread dmitriusan
AMBARI-6288. ambari-server may kill INIT and SSHD process (in some specific 
scenarios) (dlysnichenko)


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

Branch: refs/heads/branch-1.6.1
Commit: 58451d8a682b618da45e9217f0f5271babcf954a
Parents: 40d2d4d
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Jun 26 20:51:40 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Jun 26 20:51:40 2014 +0300

--
 ambari-server/src/main/python/ambari-server.py | 16 +---
 ambari-server/src/main/python/setupAgent.py|  4 ++--
 2 files changed, 11 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/58451d8a/ambari-server/src/main/python/ambari-server.py
--
diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index 20ccba2..4d9a943 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -116,6 +116,7 @@ JAVA_SHARE_PATH = /usr/share/java
 SERVER_OUT_FILE = /var/log/ambari-server/ambari-server.out
 SERVER_LOG_FILE = /var/log/ambari-server/ambari-server.log
 BLIND_PASSWORD = *
+ROOT_FS_PATH = /
 
 # terminal styles
 BOLD_ON = '\033[1m'
@@ -1404,7 +1405,7 @@ def execute_remote_script(args, scriptPath):
 # args.warnings.append('{0} not found. Please, run DDL script 
manually'.format(DATABASE_CLI_TOOLS[DATABASE_INDEX]))
 if VERBOSE:
   print_warning_msg('{0} not 
found'.format(DATABASE_CLI_TOOLS[DATABASE_INDEX]))
-return -1, Client wasn't found, Client wasn't found  
+return -1, Client wasn't found, Client wasn't found
   CMD = get_remote_script_line(args, scriptPath, False)
   if CMD:
 retcode, out, err = run_in_shell(CMD)
@@ -1418,7 +1419,7 @@ def get_remote_script_line(args, scriptPath, 
forPrint=True):
   if not tool:
 # args.warnings.append('{0} not found. Please, run DDL script 
manually'.format(DATABASE_CLI_TOOLS[DATABASE_INDEX]))
 if VERBOSE or args.persistence_type == remote:
-  print_warning_msg('{0} not 
found'.format(DATABASE_CLI_TOOLS[DATABASE_INDEX]))  
+  print_warning_msg('{0} not 
found'.format(DATABASE_CLI_TOOLS[DATABASE_INDEX]))
 return None
   if args.dbms == postgres:
 os.environ[PGPASSWORD] = args.database_password
@@ -2392,7 +2393,7 @@ def reset(args):
 
   check_database_name_property()
   parse_properties_file(args)
-  
+
   if args.persistence_type == remote:
 client_usage_cmd_drop = get_remote_script_line(args, 
DATABASE_DROP_SCRIPTS[DATABASE_INDEX])
 client_usage_cmd_init = get_remote_script_line(args, 
DATABASE_INIT_SCRIPTS[DATABASE_INDEX])
@@ -2572,19 +2573,20 @@ def start(args):
command_base.format(jdk_path,
conf_dir,
get_ambari_classpath(),
-   pidfile,
os.path.join(PID_DIR, 
EXITCODE_NAME))
)
   if not os.path.exists(PID_DIR):
 os.makedirs(PID_DIR, 0755)
 
-#For properly daemonization server should be started using shell as parent
+  # required to start properly server instance
+  os.chdir(ROOT_FS_PATH)
+
+  #For properly daemonization server should be started using shell as parent
   if is_root() and ambari_user != root:
 # To inherit exported environment variables (especially AMBARI_PASSPHRASE),
 # from subprocess, we have to skip --login option of su command. That's why
 # we change dir to / (otherwise subprocess can face with 'permission 
denied'
 # errors while trying to list current directory
-os.chdir(/)
 param_list = [utils.locate_file('su', '/bin'), ambari_user, -s, 
utils.locate_file('sh', '/bin'), -c, command]
   else:
 param_list = [utils.locate_file('sh', '/bin'), -c, command]
@@ -2643,7 +2645,7 @@ def upgrade_stack(args, stack_id, repo_url=None, 
repo_url_os=None):
 
   if not retcode == 0:
 raise FatalException(retcode, 'Stack upgrade failed.')
-  
+
   return retcode
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/58451d8a/ambari-server/src/main/python/setupAgent.py
--
diff --git a/ambari-server/src/main/python/setupAgent.py 
b/ambari-server/src/main/python/setupAgent.py
index 1fad46a..e83ed3f 100755
--- a/ambari-server/src/main/python/setupAgent.py
+++ b/ambari-server/src/main/python/setupAgent.py
@@ -200,9 +200,9 @@ def main(argv=None):
 

[1/2] git commit: AMBARI-6288. ambari-server may kill INIT and SSHD process (in some specific scenarios) (dlysnichenko)

2014-06-26 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-1.6.1 40d2d4d7c - 58451d8a6
  refs/heads/trunk 76c4c4a5a - a676f6634


AMBARI-6288. ambari-server may kill INIT and SSHD process (in some specific 
scenarios) (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: a676f6634b318f9cb3153dbd51c166e2143687c9
Parents: 76c4c4a
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Jun 26 20:30:12 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Jun 26 20:32:49 2014 +0300

--
 ambari-server/src/main/python/ambari-server.py | 18 ++
 ambari-server/src/main/python/setupAgent.py|  4 ++--
 2 files changed, 12 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a676f663/ambari-server/src/main/python/ambari-server.py
--
diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index 7987b95..8edc29d 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -116,6 +116,7 @@ JAVA_SHARE_PATH = /usr/share/java
 SERVER_OUT_FILE = /var/log/ambari-server/ambari-server.out
 SERVER_LOG_FILE = /var/log/ambari-server/ambari-server.log
 BLIND_PASSWORD = *
+ROOT_FS_PATH = /
 
 # terminal styles
 BOLD_ON = '\033[1m'
@@ -1117,7 +1118,7 @@ def check_postgre_up():
   if pg_status == PG_STATUS_RUNNING:
 return pg_status, 0, out, err
   else:
-print_error_msg(Postgres start failed.  + str(e))
+print_error_msg(Postgres start failed.  + str(e))
 return pg_status, retcode, out, err
 
 
@@ -1403,7 +1404,7 @@ def execute_remote_script(args, scriptPath):
 # args.warnings.append('{0} not found. Please, run DDL script 
manually'.format(DATABASE_CLI_TOOLS[DATABASE_INDEX]))
 if VERBOSE:
   print_warning_msg('{0} not 
found'.format(DATABASE_CLI_TOOLS[DATABASE_INDEX]))
-return -1, Client wasn't found, Client wasn't found  
+return -1, Client wasn't found, Client wasn't found
   CMD = get_remote_script_line(args, scriptPath, False)
   if CMD:
 retcode, out, err = run_in_shell(CMD)
@@ -1417,7 +1418,7 @@ def get_remote_script_line(args, scriptPath, 
forPrint=True):
   if not tool:
 # args.warnings.append('{0} not found. Please, run DDL script 
manually'.format(DATABASE_CLI_TOOLS[DATABASE_INDEX]))
 if VERBOSE or args.persistence_type == remote:
-  print_warning_msg('{0} not 
found'.format(DATABASE_CLI_TOOLS[DATABASE_INDEX]))  
+  print_warning_msg('{0} not 
found'.format(DATABASE_CLI_TOOLS[DATABASE_INDEX]))
 return None
   if args.dbms == postgres:
 os.environ[PGPASSWORD] = args.database_password
@@ -2392,7 +2393,7 @@ def reset(args):
 
   check_database_name_property()
   parse_properties_file(args)
-  
+
   if args.persistence_type == remote:
 client_usage_cmd_drop = get_remote_script_line(args, 
DATABASE_DROP_SCRIPTS[DATABASE_INDEX])
 client_usage_cmd_init = get_remote_script_line(args, 
DATABASE_INIT_SCRIPTS[DATABASE_INDEX])
@@ -2572,19 +2573,20 @@ def start(args):
command_base.format(jdk_path,
conf_dir,
get_ambari_classpath(),
-   pidfile,
os.path.join(PID_DIR, 
EXITCODE_NAME))
)
   if not os.path.exists(PID_DIR):
 os.makedirs(PID_DIR, 0755)
 
-#For properly daemonization server should be started using shell as parent
+  # required to start properly server instance
+  os.chdir(ROOT_FS_PATH)
+
+  #For properly daemonization server should be started using shell as parent
   if is_root() and ambari_user != root:
 # To inherit exported environment variables (especially AMBARI_PASSPHRASE),
 # from subprocess, we have to skip --login option of su command. That's why
 # we change dir to / (otherwise subprocess can face with 'permission 
denied'
 # errors while trying to list current directory
-os.chdir(/)
 param_list = [utils.locate_file('su', '/bin'), ambari_user, -s, 
utils.locate_file('sh', '/bin'), -c, command]
   else:
 param_list = [utils.locate_file('sh', '/bin'), -c, command]
@@ -2643,7 +2645,7 @@ def upgrade_stack(args, stack_id, repo_url=None, 
repo_url_os=None):
 
   if not retcode == 0:
 raise FatalException(retcode, 'Stack upgrade failed.')
-  
+
   return retcode
 
 


git commit: AMBARI-6339. Hive client download problems (reported in forums) (dlysnichenko)

2014-07-01 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-1.6.1 7c3c88d44 - a6a704669


AMBARI-6339. Hive client download problems (reported in forums) (dlysnichenko)


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

Branch: refs/heads/branch-1.6.1
Commit: a6a7046697ceced19e6f85d5254872daaa3051ea
Parents: 7c3c88d
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Jul 1 21:08:25 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Jul 1 21:21:55 2014 +0300

--
 .../1.3.2/hooks/before-ANY/scripts/shared_initialization.py| 4 ++--
 .../hooks/before-INSTALL/scripts/shared_initialization.py  | 2 +-
 .../1.3.2/hooks/before-START/scripts/shared_initialization.py  | 4 ++--
 .../stacks/HDP/1.3.2/services/HIVE/package/scripts/hive.py | 4 ++--
 .../stacks/HDP/1.3.2/services/OOZIE/package/scripts/oozie.py   | 2 +-
 .../2.0.6/hooks/before-ANY/scripts/shared_initialization.py| 4 ++--
 .../hooks/before-INSTALL/scripts/shared_initialization.py  | 2 +-
 .../2.0.6/hooks/before-START/scripts/shared_initialization.py  | 4 ++--
 .../stacks/HDP/2.0.6/services/HIVE/package/scripts/hive.py | 4 ++--
 .../stacks/HDP/2.0.6/services/OOZIE/package/scripts/oozie.py   | 2 +-
 .../src/test/python/stacks/1.3.2/HIVE/test_hive_client.py  | 6 +++---
 .../src/test/python/stacks/1.3.2/HIVE/test_hive_metastore.py   | 4 ++--
 .../src/test/python/stacks/1.3.2/HIVE/test_hive_server.py  | 4 ++--
 .../stacks/1.3.2/hooks/before-INSTALL/test_before_install.py   | 4 ++--
 .../src/test/python/stacks/2.0.6/HIVE/test_hive_client.py  | 4 ++--
 .../src/test/python/stacks/2.0.6/HIVE/test_hive_metastore.py   | 4 ++--
 .../src/test/python/stacks/2.0.6/HIVE/test_hive_server.py  | 4 ++--
 .../stacks/2.0.6/hooks/before-INSTALL/test_before_install.py   | 2 +-
 .../src/test/python/stacks/2.1/HIVE/test_hive_metastore.py | 4 ++--
 19 files changed, 34 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a6a70466/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-ANY/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-ANY/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-ANY/scripts/shared_initialization.py
index 70a1623..74bdce0 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-ANY/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-ANY/scripts/shared_initialization.py
@@ -36,7 +36,7 @@ def setup_jce():
   if params.jce_policy_zip is not None:
 jce_curl_target = format({artifact_dir}/{jce_policy_zip})
 download_jce = format(mkdir -p {artifact_dir}; \
-curl -kf --retry 10 \
+curl -kf -x \\ --retry 10 \
 {jce_location}/{jce_policy_zip} -o {jce_curl_target})
 Execute( download_jce,
  path = [/bin,/usr/bin/],
@@ -55,4 +55,4 @@ def setup_jce():
 only_if = format(test -e {security_dir}  test -f 
{jce_curl_target}),
 cwd  = security_dir,
 path = ['/bin/','/usr/bin']
-)
\ No newline at end of file
+)

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6a70466/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
index 554db28..f88d429 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-INSTALL/scripts/shared_initialization.py
@@ -154,7 +154,7 @@ def setup_java():
 no_proxy: format({ambari_server_hostname})
   }
 
-  Execute(format(mkdir -p {artifact_dir} ; curl -kf 
+  Execute(format(mkdir -p {artifact_dir} ; curl -kf -x \\ 
  --retry 10 {jdk_location}/{jdk_name} -o {jdk_curl_target}),
   path = [/bin,/usr/bin/],
   not_if = format(test -e {java_exec}),

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6a70466/ambari-server/src/main/resources/stacks/HDP/1.3.2/hooks/before-START/scripts/shared_initialization.py
--
diff --git 

git commit: AMBARI-6371. Percent Datanodes live count in is not updated in real time. (dlysnichenko)

2014-07-03 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/trunk d3134ce01 - 64b4727cb


AMBARI-6371. Percent Datanodes live count in is not updated in real time. 
(dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 64b4727cb63659927e2c755912da44866ea3850d
Parents: d3134ce
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Thu Jul 3 13:22:19 2014 +0300
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Thu Jul 3 13:22:19 2014 +0300

--
 .../1.3.2/services/NAGIOS/package/templates/hadoop-services.cfg.j2 | 2 +-
 .../2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/64b4727c/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-services.cfg.j2
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-services.cfg.j2
 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-services.cfg.j2
index fea..8fe3c42 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-services.cfg.j2
+++ 
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-services.cfg.j2
@@ -70,7 +70,7 @@ define service {
 service_description HDFS::Percent DataNodes with space available
 servicegroups   HDFS
 check_command   check_aggregate!DATANODE::DataNode 
space!10%!30%
-normal_check_interval   2
+normal_check_interval   0.5
 retry_check_interval1 
 max_check_attempts  1
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/64b4727c/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
index 35bdaec..8f70340 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2
@@ -70,7 +70,7 @@ define service {
 service_description HDFS::Percent DataNodes with space available
 servicegroups   HDFS
 check_command   check_aggregate!DATANODE::DataNode 
space!10%!30%
-normal_check_interval   2
+normal_check_interval   0.5
 retry_check_interval1 
 max_check_attempts  1
 }



git commit: AMBARI-3903. Unit Test broken on trunk (dlysnichenko)

2013-11-27 Thread dmitriusan
Updated Branches:
  refs/heads/trunk dd535bcf8 - 1b20485fe


AMBARI-3903. Unit Test broken on trunk (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 1b20485fed5dd4803435aa6671da2417ff6568d1
Parents: dd535bc
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Wed Nov 27 15:06:58 2013 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Wed Nov 27 15:06:58 2013 +0200

--
 .../api/util/StackExtensionHelperTest.java  | 38 +---
 1 file changed, 25 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1b20485f/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
--
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
index 4a65dad..152a6b5 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
@@ -48,12 +48,19 @@ public class StackExtensionHelperTest {
 assertEquals(RESOURCEMANAGER, components.get(0).getName());
 assertEquals(MASTER, components.get(0).getCategory());
 ListPropertyInfo properties = serviceInfo.getProperties();
-// Check some properties
+// Check some property
 assertEquals(4, properties.size());
-assertEquals(yarn.resourcemanager.resource-tracker.address,
-properties.get(0).getName());
-assertEquals(localhost:8025,
-properties.get(0).getValue());
+boolean found = false;
+for (PropertyInfo property : properties) {
+  if 
(property.getName().equals(yarn.resourcemanager.resource-tracker.address)) {
+assertEquals(localhost:8025, property.getValue());
+assertEquals(yarn-site.xml,
+property.getFilename());
+assertEquals(true, property.isDeleted());
+found = true;
+  }
+}
+assertTrue(Property not found in a list of properties, found);
 // Check config dependencies
 ListString configDependencies = serviceInfo.getConfigDependencies();
 assertEquals(1, configDependencies.size());
@@ -122,16 +129,21 @@ public class StackExtensionHelperTest {
 assertEquals(CommandScriptDefinition.Type.PYTHON,
 serviceScriptDefinition.getScriptType());
 assertEquals(50, serviceScriptDefinition.getTimeout());
-// Check some properties
+// Check some property
 ListPropertyInfo properties = serviceInfo.getProperties();
 assertEquals(38, properties.size());
-assertEquals(hbase.cluster.distributed,
-properties.get(0).getName());
-assertEquals(true,
-properties.get(0).getValue());
-assertTrue(properties.get(0).getDescription().startsWith(The mode 
the));
-assertEquals(hbase-site.xml,
-properties.get(0).getFilename());
+boolean found = false;
+for (PropertyInfo property : properties) {
+  if (property.getName().equals(hbase.cluster.distributed)) {
+assertEquals(true,
+property.getValue());
+assertTrue(property.getDescription().startsWith(The mode the));
+assertEquals(hbase-site.xml,
+property.getFilename());
+found = true;
+  }
+}
+assertTrue(Property not found in a list of properties, found);
 ListString configDependencies = serviceInfo.getConfigDependencies();
 assertEquals(3, configDependencies.size());
 assertEquals(global, configDependencies.get(0));



git commit: AMBARI-3931. Sqoop on HDP2. Using resource management lib (Eugene Chekanskiy via dlysnichenko)

2013-11-29 Thread dmitriusan
Updated Branches:
  refs/heads/trunk 95ba3b452 - d2ebacc09


AMBARI-3931. Sqoop on HDP2. Using resource management lib (Eugene Chekanskiy 
via dlysnichenko)


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

Branch: refs/heads/trunk
Commit: d2ebacc09e91ebdbf9b2442864214b28af56
Parents: 95ba3b4
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Nov 29 18:33:27 2013 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Nov 29 18:33:27 2013 +0200

--
 .../HDP/2.0._/services/SQOOP/metainfo.xml   | 46 ++---
 .../services/SQOOP/package/scripts/__init__.py  | 21 
 .../services/SQOOP/package/scripts/params.py| 40 +++
 .../SQOOP/package/scripts/service_check.py  | 39 ++
 .../services/SQOOP/package/scripts/sqoop.py | 54 
 .../SQOOP/package/scripts/sqoop_client.py   | 40 +++
 .../SQOOP/package/templates/sqoop-env.sh.j2 | 36 +
 7 files changed, 268 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d2ebacc0/ambari-server/src/main/resources/stacks/HDP/2.0._/services/SQOOP/metainfo.xml
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/SQOOP/metainfo.xml 
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/SQOOP/metainfo.xml
index 9a50700..0070c34 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/SQOOP/metainfo.xml
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/SQOOP/metainfo.xml
@@ -16,15 +16,45 @@
limitations under the License.
 --
 metainfo
-userroot/user
-commentTool for transferring bulk data between Apache Hadoop and 
structured data stores such as relational databases/comment
-version1.4.4.2.0.6.0/version
+  schemaVersion2.0/schemaVersion
+  services
+service
+  nameSQOOP/name
+  commentTool for transferring bulk data between Apache Hadoop and
+structured data stores such as relational databases
+  /comment
+  version1.4.4.2.0.6.0/version
 
-components
+  components
 component
-nameSQOOP/name
-categoryCLIENT/category
+  nameSQOOP/name
+  categoryCLIENT/category
+  commandScript
+scriptscripts/sqoop_client.py/script
+scriptTypePYTHON/scriptType
+  /commandScript
 /component
-/components
-
+  /components
+  osSpecifics
+osSpecific
+  osTypeany/osType
+  packages
+package
+  typerpm/type
+  namesqoop/name
+/package
+package
+  typerpm/type
+  namemysql-connector-java/name
+/package
+  /packages
+/osSpecific
+  /osSpecifics
+  commandScript
+scriptscripts/service_check.py/script
+scriptTypePYTHON/scriptType
+timeout300/timeout
+  /commandScript
+/service
+  /services
 /metainfo

http://git-wip-us.apache.org/repos/asf/ambari/blob/d2ebacc0/ambari-server/src/main/resources/stacks/HDP/2.0._/services/SQOOP/package/scripts/__init__.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/SQOOP/package/scripts/__init__.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/SQOOP/package/scripts/__init__.py
new file mode 100644
index 000..b80fda6
--- /dev/null
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/SQOOP/package/scripts/__init__.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python2.6
+
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+License); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an AS IS BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Ambari Agent
+
+


[1/4] AMBARI-3852. 'memMaxM' is required for NameNode from metrics/jvm call. Additional fixes (Vitaly Brodetskyi via dlysnichenko)

2013-12-03 Thread dmitriusan
Updated Branches:
  refs/heads/branch-1.4.2 27898706f - 831e71cc8
  refs/heads/trunk 8f309f4e8 - 36c563665


http://git-wip-us.apache.org/repos/asf/ambari/blob/36c56366/ambari-server/src/main/resources/stacks/HDP/2.0._/services/HDFS/metrics.json
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/HDFS/metrics.json 
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/HDFS/metrics.json
index adacb93..2e70925 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/HDFS/metrics.json
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/HDFS/metrics.json
@@ -739,6 +739,11 @@
 pointInTime: true,
 temporal: false
   },
+  metrics/jvm/memMaxM:{
+metric : Hadoop:service=NameNode,name=JvmMetrics.MemMaxM,
+pointInTime : true,
+temporal : false
+  },
   metrics/dfs/FSNamesystem/BlockCapacity: {
 metric: 
Hadoop:service=NameNode,name=FSNamesystemMetrics.BlockCapacity,
 pointInTime: true,
@@ -2131,6 +2136,11 @@
 pointInTime: true,
 temporal: false
   },
+  metrics/jvm/memMaxM:{
+metric : Hadoop:service=NameNode,name=JvmMetrics.MemMaxM,
+pointInTime : true,
+temporal : false
+  },
   metrics/dfs/FSNamesystem/BlockCapacity: {
 metric: 
Hadoop:service=NameNode,name=FSNamesystem.BlockCapacity,
 pointInTime: true,
@@ -7787,4 +7797,4 @@
   }
 ]
   }
-}
+}
\ No newline at end of file



[1/3] git commit: AMBARI-3959. Fix config generation for Ganglia on stack 2 using resource management framework (Eugene Chekanskiy via dlysnichenko)

2013-12-03 Thread dmitriusan
Updated Branches:
  refs/heads/branch-1.4.2 2fb24d9d2 - f0b798e32
  refs/heads/trunk 325335b04 - b245ca7f2


AMBARI-3959. Fix config generation for Ganglia on stack 2 using resource 
management framework (Eugene Chekanskiy via dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 6c8cba1df31c655b0d2d6972e53155d514823230
Parents: 325335b
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Tue Dec 3 20:14:35 2013 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Tue Dec 3 20:14:35 2013 +0200

--
 .../HDP/2.0._/services/GANGLIA/package/scripts/ganglia_server.py   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6c8cba1d/ambari-server/src/main/resources/stacks/HDP/2.0._/services/GANGLIA/package/scripts/ganglia_server.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/GANGLIA/package/scripts/ganglia_server.py
 
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/GANGLIA/package/scripts/ganglia_server.py
index de2c8cc..02785d3 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0._/services/GANGLIA/package/scripts/ganglia_server.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0._/services/GANGLIA/package/scripts/ganglia_server.py
@@ -86,7 +86,7 @@ class GangliaServer(Script):
   role = server,
   owner = root,
   group = params.user_group)
-generate_daemon(gmond,
+generate_daemon(gmetad,
 name = gmetad,
 role = server,
 owner = root,



[2/2] git commit: AMBARI-3994. Create repository install functionality in the base script (Andrew Onischuk via dlysnichenko)

2013-12-06 Thread dmitriusan
AMBARI-3994. Create repository install functionality in the base script (Andrew 
Onischuk via dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 48e2184fe1e5b0f543d41551d50d2f0be41b58fe
Parents: fc3024c
Author: Lisnichenko Dmitro dlysniche...@hortonworks.com
Authored: Fri Dec 6 20:19:09 2013 +0200
Committer: Lisnichenko Dmitro dlysniche...@hortonworks.com
Committed: Fri Dec 6 20:19:09 2013 +0200

--
 .../libraries/providers/__init__.py |  3 +-
 .../libraries/providers/repository.py   | 53 +
 .../libraries/resources/__init__.py |  3 +-
 .../libraries/resources/repository.py   | 34 +++
 .../libraries/script/config_dictionary.py   | 59 +++
 .../libraries/script/repo_installer.py  | 60 
 .../libraries/script/script.py  | 47 +++
 7 files changed, 217 insertions(+), 42 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/48e2184f/ambari-agent/src/main/python/resource_management/libraries/providers/__init__.py
--
diff --git 
a/ambari-agent/src/main/python/resource_management/libraries/providers/__init__.py
 
b/ambari-agent/src/main/python/resource_management/libraries/providers/__init__.py
index 89a31e9..65bbb49 100644
--- 
a/ambari-agent/src/main/python/resource_management/libraries/providers/__init__.py
+++ 
b/ambari-agent/src/main/python/resource_management/libraries/providers/__init__.py
@@ -35,6 +35,7 @@ PROVIDERS = dict(
 
ExecuteHadoop=resource_management.libraries.providers.execute_hadoop.ExecuteHadoopProvider,
 
TemplateConfig=resource_management.libraries.providers.template_config.TemplateConfigProvider,
 
XmlConfig=resource_management.libraries.providers.xml_config.XmlConfigProvider,
-
MonitorWebserver=resource_management.libraries.providers.monitor_webserver.MonitorWebserverProvider
+
MonitorWebserver=resource_management.libraries.providers.monitor_webserver.MonitorWebserverProvider,
+
Repository=resource_management.libraries.providers.repository.RepositoryProvider
   ),
 )

http://git-wip-us.apache.org/repos/asf/ambari/blob/48e2184f/ambari-agent/src/main/python/resource_management/libraries/providers/repository.py
--
diff --git 
a/ambari-agent/src/main/python/resource_management/libraries/providers/repository.py
 
b/ambari-agent/src/main/python/resource_management/libraries/providers/repository.py
new file mode 100644
index 000..70ecdb7
--- /dev/null
+++ 
b/ambari-agent/src/main/python/resource_management/libraries/providers/repository.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python2.6
+
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+License); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an AS IS BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Ambari Agent
+
+
+
+from resource_management import *
+
+class RepositoryProvider(Provider):
+  def action_create(self):
+with Environment.get_instance_copy() as env:
+  repo_file_name = self.resource.repo_file_name
+  repo_dir = repos_dirs[env.system.platform]
+  
+  File(format({repo_dir}/{repo_file_name}.repo),
+content = InlineTemplate([{{repo_id}}]
+name={{repo_file_name}}
+{% if mirror_list %}mirrorlist={{mirror_list}}{% else %}baseurl={{base_url}}{% 
endif %}
+path=/
+enabled=1
+gpgcheck=0, repo_id=self.resource.repo_id, 
repo_file_name=self.resource.repo_file_name, base_url=self.resource.base_url, 
mirror_list=self.resource.mirror_list)
+  )
+  
+  def action_remove(self):
+with Environment.get_instance_copy() as env:
+  repo_file_name = self.resource.repo_file_name
+  repo_dir = repos_dirs[env.system.platform]
+
+  File(format({repo_dir}/{repo_file_name}.repo),
+   action = delete)
+
+  
+repos_dirs = {
+  'centos': '/etc/yum.repos.d',
+  'redhat': '/etc/yum.repos.d',
+  'suse': 

  1   2   3   4   5   6   7   8   9   10   >