ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject ambari git commit: AMBARI-21950. Package Installation is failing If Patch-VDF contain service that is not installed in the cluster (ncole)
Date Thu, 14 Sep 2017 14:44:38 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 38604db2f -> 1f6b9daf2


AMBARI-21950. Package Installation is failing If Patch-VDF contain service that is not installed
in the cluster (ncole)


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

Branch: refs/heads/trunk
Commit: 1f6b9daf2f7e559705c00d2ac8428af1337f5e4d
Parents: 38604db
Author: Nate Cole <ncole@hortonworks.com>
Authored: Thu Sep 14 09:29:25 2017 -0400
Committer: Nate Cole <ncole@hortonworks.com>
Committed: Thu Sep 14 10:44:35 2017 -0400

----------------------------------------------------------------------
 .../internal/ClusterStackVersionResourceProvider.java       | 4 +---
 .../internal/ClusterStackVersionResourceProviderTest.java   | 9 ++++++++-
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1f6b9daf/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 85a7596..f8a679a 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
@@ -497,6 +497,7 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
       }
     }
 
+    checkPatchVDFAvailableServices(cluster, repoVersionEntity, versionDefinitionXml);
 
     // the cluster will create/update all of the host versions to the correct state
     List<Host> hostsNeedingInstallCommands = cluster.transitionHostsToInstalling(
@@ -595,9 +596,6 @@ public class ClusterStackVersionResourceProvider extends AbstractControllerResou
       // determine services for the repo
       Set<String> serviceNames = new HashSet<>();
 
-
-      checkPatchVDFAvailableServices(cluster, repoVersionEnt, desiredVersionDefinition);
-
       // !!! limit the serviceNames to those that are detailed for the repository.
       // TODO packages don't have component granularity
       if (RepositoryType.STANDARD != repoVersionEnt.getType()) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/1f6b9daf/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
index 654067b..c766f1e 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java
@@ -127,6 +127,8 @@ import com.google.inject.Injector;
 import com.google.inject.Provider;
 import com.google.inject.util.Modules;
 
+import junit.framework.AssertionFailedError;
+
 
  /**
  * ClusterStackVersionResourceProvider tests.
@@ -1852,6 +1854,9 @@ public class ClusterStackVersionResourceProviderTest {
 
     expect(desiredVersionDefinition.getAvailableServices((StackInfo)EasyMock.anyObject())).andReturn(availableServices).once();
 
+    expect(cluster.transitionHostsToInstalling(
+        anyObject(RepositoryVersionEntity.class), anyObject(VersionDefinitionXml.class),
+        EasyMock.anyBoolean())).andReturn(Collections.<Host>emptyList()).atLeastOnce();
 
     replay(cluster, repoVersionEnt, desiredVersionDefinition, service1, service2, availableService1,
availableService2);
 
@@ -1890,7 +1895,9 @@ public class ClusterStackVersionResourceProviderTest {
      availableServices.add(availableService2);
 
      expect(desiredVersionDefinition.getAvailableServices((StackInfo)EasyMock.anyObject())).andReturn(availableServices).once();
-
+     expect(cluster.transitionHostsToInstalling(
+         anyObject(RepositoryVersionEntity.class), anyObject(VersionDefinitionXml.class),
+         EasyMock.anyBoolean())).andThrow(new AssertionFailedError()).anyTimes();
 
      replay(cluster, repoVersionEnt, desiredVersionDefinition, service1, availableService1,
availableService2);
 


Mime
View raw message