This is an automated email from the ASF dual-hosted git repository.
amagyar pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new d1df5d3 [AMBARI-23389]. Install Packages button on the versions
screen fails if there is a service installed which was removed (amagyar) (#813)
d1df5d3 is described below
commit d1df5d3781b21a915ec2113069d46c98ff2908ab
Author: Attila Magyar <[email protected]>
AuthorDate: Thu Mar 29 08:32:44 2018 +0200
[AMBARI-23389]. Install Packages button on the versions screen fails if
there is a service installed which was removed (amagyar) (#813)
* AMBARI-23389. Install Packages button on the versions screen fails if
there is a service installed which was removed (amagyar)
* AMBARI-23389. Install Packages button on the versions screen fails if
there is a service installed which was removed (amagyar)
* AMBARI-23389. Install Packages button on the versions screen fails if
there is a service installed which was removed (amagyar)
---
.../controller/internal/ClusterStackVersionResourceProvider.java | 2 ++
.../src/main/java/org/apache/ambari/server/state/StackInfo.java | 8 ++++++++
2 files changed, 10 insertions(+)
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 5a54a28..837a7e2 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
@@ -625,6 +625,8 @@ public class ClusterStackVersionResourceProvider extends
AbstractControllerResou
if (RepositoryType.STANDARD != repoVersionEnt.getType()) {
ClusterVersionSummary clusterSummary =
desiredVersionDefinition.getClusterSummary(cluster);
serviceNames.addAll(clusterSummary.getAvailableServiceNames());
+ } else {
+ serviceNames.addAll(ami.getStack(stackId).getServiceNames());
}
// Populate with commands for host
diff --git
a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
index 70d5926..c286532 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
@@ -28,6 +28,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.stream.Collectors;
import org.apache.ambari.server.controller.StackVersionResponse;
import org.apache.ambari.server.stack.Validable;
@@ -614,4 +615,11 @@ public class StackInfo implements Comparable<StackInfo>,
Validable {
public void setRefreshCommandConfiguration(RefreshCommandConfiguration
refreshCommandConfiguration) {
this.refreshCommandConfiguration = refreshCommandConfiguration;
}
+
+ /**
+ * @return names of each service in the stack
+ */
+ public Set<String> getServiceNames() {
+ return
getServices().stream().map(ServiceInfo::getName).collect(Collectors.toSet());
+ }
}
--
To stop receiving notification emails like this one, please contact
[email protected].