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-16462. Provide default VDF for enabled stacks (ncole)
Date Thu, 12 May 2016 16:55:59 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk aab01b70c -> 392e57dc5


AMBARI-16462.  Provide default VDF for enabled stacks (ncole)


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

Branch: refs/heads/trunk
Commit: 392e57dc5b653ae9756a2416c4858b60c5878e37
Parents: aab01b7
Author: Nate Cole <ncole@hortonworks.com>
Authored: Wed May 11 14:59:44 2016 -0400
Committer: Nate Cole <ncole@hortonworks.com>
Committed: Thu May 12 12:53:45 2016 -0400

----------------------------------------------------------------------
 .../server/api/services/AmbariMetaInfo.java     | 27 ++++++++-
 .../VersionDefinitionResourceProvider.java      | 27 +++++----
 .../apache/ambari/server/stack/StackModule.java |  2 +
 .../apache/ambari/server/state/StackInfo.java   | 28 ++++++----
 .../state/repository/VersionDefinitionXml.java  | 58 +++++++++++++++++++-
 .../server/state/stack/LatestRepoCallable.java  | 52 ++++++++++++------
 .../VersionDefinitionResourceProviderTest.java  | 18 +++++-
 .../HostVersionOutOfSyncListenerTest.java       |  2 +-
 .../server/state/cluster/ClusterTest.java       |  4 +-
 .../stacks/HDP/2.2.0/repos/repoinfo.xml         | 28 ----------
 10 files changed, 170 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/392e57dc/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
index 77f2ede..c54fe3f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
@@ -82,6 +82,7 @@ import org.apache.ambari.server.state.stack.Metric;
 import org.apache.ambari.server.state.stack.MetricDefinition;
 import org.apache.ambari.server.state.stack.OsFamily;
 import org.apache.ambari.server.state.stack.UpgradePack;
+import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -1354,14 +1355,35 @@ public class AmbariMetaInfo {
    * Ensures that the map of version definition files is populated
    */
   private void ensureVersionDefinitions() {
-    if (null == versionDefinitions) {
-      versionDefinitions = new HashMap<>();
+    if (null != versionDefinitions) {
+      return;
     }
+
+    versionDefinitions = new HashMap<>();
+
     for (StackInfo stack : getStacks()) {
       for (VersionDefinitionXml definition : stack.getVersionDefinitions()) {
         versionDefinitions.put(String.format("%s-%s-%s", stack.getName(),
             stack.getVersion(), definition.release.version), definition);
       }
+
+      if (stack.isActive() && stack.isValid()) {
+        try {
+          VersionDefinitionXml xml = VersionDefinitionXml.build(stack);
+          versionDefinitions.put(String.format("%s-%s", stack.getName(), stack.getVersion()),
xml);
+        } catch (Exception e) {
+          LOG.warn("Could not make a stack VDF for {}-{}: {}",
+              stack.getName(), stack.getVersion(), e.getMessage());
+        }
+      } else {
+        StackId stackId = new StackId(stack);
+        if (!stack.isValid()) {
+          LOG.info("Stack {} is not valid, skipping VDF: {}", stackId, StringUtils.join(stack.getErrors(),
"; "));
+        } else if (!stack.isActive()) {
+          LOG.info("Stack {} is not active, skipping VDF", stackId);
+        }
+      }
+
     }
   }
 
@@ -1384,4 +1406,5 @@ public class AmbariMetaInfo {
     return versionDefinitions;
   }
 
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/392e57dc/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java
index 94b9648..049c4a7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProvider.java
@@ -97,6 +97,7 @@ public class VersionDefinitionResourceProvider extends AbstractAuthorizedResourc
   protected static final String VERSION_DEF_RELEASE_COMPATIBLE_WITH  = "VersionDefinition/release/compatible_with";
   protected static final String VERSION_DEF_AVAILABLE_SERVICES       = "VersionDefinition/services";
   protected static final String VERSION_DEF_STACK_SERVICES           = "VersionDefinition/stack_services";
+  protected static final String VERSION_DEF_STACK_DEFAULT            = "VersionDefinition/stack_default";
   protected static final String SHOW_AVAILABLE                       = "VersionDefinition/show_available";
 
   public static final String SUBRESOURCE_OPERATING_SYSTEMS_PROPERTY_ID  = new OperatingSystemResourceDefinition().getPluralName();
@@ -144,6 +145,7 @@ public class VersionDefinitionResourceProvider extends AbstractAuthorizedResourc
       VERSION_DEF_RELEASE_BUILD,
       VERSION_DEF_AVAILABLE_SERVICES,
       VERSION_DEF_STACK_SERVICES,
+      VERSION_DEF_STACK_DEFAULT,
       SUBRESOURCE_OPERATING_SYSTEMS_PROPERTY_ID,
       SHOW_AVAILABLE);
 
@@ -259,9 +261,11 @@ public class VersionDefinitionResourceProvider extends AbstractAuthorizedResourc
         VERSION_DEF_AVAILABLE_SERVICES,
         VERSION_DEF_STACK_SERVICES);
 
-      boolean fromAvailable = null != definitionName;
-
-      res = toResource(null, xmlHolder.xml, ids, fromAvailable);
+      res = toResource(null, xmlHolder.xml, ids);
+      // !!! if the definition name is not null, it can only be from available
+      if (null != definitionName) {
+        res.setProperty(SHOW_AVAILABLE, true);
+      }
 
       addSubresources(res, xmlHolder.entity);
     } else {
@@ -298,7 +302,10 @@ public class VersionDefinitionResourceProvider extends AbstractAuthorizedResourc
             Boolean.parseBoolean(propertyMap.get(SHOW_AVAILABLE).toString())) {
 
           for (Entry<String, VersionDefinitionXml> entry : s_metaInfo.get().getVersionDefinitions().entrySet())
{
-            results.add(toResource(entry.getKey(), entry.getValue(), requestPropertyIds,
true));
+            Resource res = toResource(entry.getKey(), entry.getValue(), requestPropertyIds);
+            res.setProperty(SHOW_AVAILABLE, true);
+            results.add(res);
+
           }
 
         } else {
@@ -318,8 +325,9 @@ public class VersionDefinitionResourceProvider extends AbstractAuthorizedResourc
                 throw new NoSuchResourceException(String.format("Could not find version %s",
                     id));
               }
-              results.add(toResource(id, xml, requestPropertyIds, true));
-
+              Resource res = toResource(id, xml, requestPropertyIds);
+              res.setProperty(SHOW_AVAILABLE, true);
+              results.add(res);
             }
           } else {
             List<RepositoryVersionEntity> versions = s_repoVersionDAO.findAllDefinitions();
@@ -514,13 +522,10 @@ public class VersionDefinitionResourceProvider extends AbstractAuthorizedResourc
    * @return the resource
    * @throws SystemException
    */
-  private Resource toResource(String id, VersionDefinitionXml xml, Set<String> requestedIds,
boolean fromAvailable) throws SystemException {
+  private Resource toResource(String id, VersionDefinitionXml xml, Set<String> requestedIds)
throws SystemException {
 
     Resource resource = new ResourceImpl(Resource.Type.VersionDefinition);
     resource.setProperty(VERSION_DEF_ID, id);
-    if (fromAvailable) {
-      resource.setProperty(SHOW_AVAILABLE, Boolean.TRUE);
-    }
 
     StackId stackId = new StackId(xml.release.stackId);
 
@@ -541,6 +546,7 @@ public class VersionDefinitionResourceProvider extends AbstractAuthorizedResourc
     setResourceProperty(resource, VERSION_DEF_RELEASE_COMPATIBLE_WITH, xml.release.compatibleWith,
requestedIds);
     setResourceProperty(resource, VERSION_DEF_RELEASE_NOTES, xml.release.releaseNotes, requestedIds);
     setResourceProperty(resource, VERSION_DEF_RELEASE_VERSION, xml.release.version, requestedIds);
+    setResourceProperty(resource, VERSION_DEF_STACK_DEFAULT, xml.isStackDefault(), requestedIds);
 
     setResourceProperty(resource, VERSION_DEF_AVAILABLE_SERVICES, xml.getAvailableServices(stack),
requestedIds);
     setResourceProperty(resource, VERSION_DEF_STACK_SERVICES, xml.getStackServices(stack),
requestedIds);
@@ -584,6 +590,7 @@ public class VersionDefinitionResourceProvider extends AbstractAuthorizedResourc
     setResourceProperty(resource, VERSION_DEF_RELEASE_COMPATIBLE_WITH, xml.release.compatibleWith,
requestedIds);
     setResourceProperty(resource, VERSION_DEF_RELEASE_NOTES, xml.release.releaseNotes, requestedIds);
     setResourceProperty(resource, VERSION_DEF_RELEASE_VERSION, xml.release.version, requestedIds);
+    setResourceProperty(resource, VERSION_DEF_STACK_DEFAULT, xml.isStackDefault(), requestedIds);
 
     StackInfo stack = null;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/392e57dc/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
index 6129ec0..5a18b3f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java
@@ -654,6 +654,8 @@ public class StackModule extends BaseModule<StackModule, StackInfo>
implements V
       return;
     }
 
+    stackInfo.setRepositoryXml(rxml);
+
     LOG.debug("Adding repositories to stack" +
         ", stackName=" + stackInfo.getName() +
         ", stackVersion=" + stackInfo.getVersion() +

http://git-wip-us.apache.org/repos/asf/ambari/blob/392e57dc/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java
----------------------------------------------------------------------
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 9fb6106..c7738cd 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
@@ -33,6 +33,7 @@ import org.apache.ambari.server.controller.StackVersionResponse;
 import org.apache.ambari.server.stack.Validable;
 import org.apache.ambari.server.state.repository.VersionDefinitionXml;
 import org.apache.ambari.server.state.stack.ConfigUpgradePack;
+import org.apache.ambari.server.state.stack.RepositoryXml;
 import org.apache.ambari.server.state.stack.StackRoleCommandOrder;
 import org.apache.ambari.server.state.stack.UpgradePack;
 
@@ -63,13 +64,11 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
    * applied to all commands for services in current stack.
    */
   private String stackHooksFolder;
-
   private String upgradesFolder = null;
-
   private volatile Map<String, PropertyInfo> requiredProperties;
-
   private Map<String, VersionDefinitionXml> versionDefinitions = new ConcurrentHashMap<>();
-
+  private Set<String> errorSet = new HashSet<String>();
+  private RepositoryXml repoXml = null;
 
   public String getMinJdk() {
     return minJdk;
@@ -105,8 +104,6 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
     this.valid = valid;
   }
 
-  private Set<String> errorSet = new HashSet<String>();
-
   @Override
   public void addError(String error) {
     errorSet.add(error);
@@ -143,9 +140,6 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
     return repositories;
   }
 
-  public void setRepositories(List<RepositoryInfo> repositories) {
-    this.repositories = repositories;
-  }
 
   public synchronized Collection<ServiceInfo> getServices() {
     if (services == null) services = new ArrayList<ServiceInfo>();
@@ -261,8 +255,6 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
     // Get the stack-level Kerberos descriptor file path
     String stackDescriptorFileFilePath = getKerberosDescriptorFileLocation();
 
-    String widgetDescriptorFilePath = getWidgetsDescriptorFileLocation();
-
     // Collect the services' Kerberos descriptor files
     Collection<ServiceInfo> serviceInfos = getServices();
     // The collection of service descriptor files. A Set is being used because some Kerberos
descriptor
@@ -478,4 +470,18 @@ public class StackInfo implements Comparable<StackInfo>, Validable{
     return versionDefinitions.values();
   }
 
+  /**
+   * @param rxml  the repository xml object
+   */
+  public void setRepositoryXml(RepositoryXml rxml) {
+    repoXml = rxml;
+  }
+
+  /**
+   * @return the repository xml object, or {@code null} if it couldn't be loaded
+   */
+  public RepositoryXml getRepositoryXml() {
+    return repoXml;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/392e57dc/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
index 3111a4a..f6863be 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/repository/VersionDefinitionXml.java
@@ -55,6 +55,7 @@ import org.apache.ambari.server.state.StackInfo;
 import org.apache.ambari.server.state.repository.AvailableVersion.Component;
 import org.apache.ambari.server.state.stack.RepositoryXml;
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
 
 /**
  * Class that wraps a repository definition file.
@@ -63,6 +64,9 @@ import org.apache.commons.io.IOUtils;
 @XmlAccessorType(XmlAccessType.FIELD)
 public class VersionDefinitionXml {
 
+  public static String SCHEMA_LOCATION = "version_definition.xsd";
+
+
   /**
    * Release details.
    */
@@ -102,6 +106,9 @@ public class VersionDefinitionXml {
   @XmlTransient
   private List<ManifestServiceInfo> m_manifest = null;
 
+  @XmlTransient
+  private boolean m_stackDefault = false;
+
 
   /**
    * @param stack the stack info needed to lookup service and component display names
@@ -132,6 +139,14 @@ public class VersionDefinitionXml {
   }
 
   /**
+   * Gets if the version definition was built as the default for a stack
+   * @return {@code true} if default for a stack
+   */
+  public boolean isStackDefault() {
+    return m_stackDefault;
+  }
+
+  /**
    * Gets the list of stack services, applying information from the version definition.
    * @param stack the stack for which to get the information
    * @return the list of {@code ManifestServiceInfo} instances for each service in the stack
@@ -317,6 +332,48 @@ public class VersionDefinitionXml {
   }
 
   /**
+   * Builds a Version Definition that is the default for the stack
+   * @param stack
+   * @return the version definition
+   */
+  public static VersionDefinitionXml build(StackInfo stackInfo) {
+
+    VersionDefinitionXml xml = new VersionDefinitionXml();
+    xml.m_stackDefault = true;
+    xml.release = new Release();
+    xml.repositoryInfo = new RepositoryXml();
+    xml.xsdLocation = SCHEMA_LOCATION;
+
+    StackId stackId = new StackId(stackInfo.getName(), stackInfo.getVersion());
+
+    xml.release.repositoryType = RepositoryType.STANDARD;
+    xml.release.stackId = stackId.toString();
+    xml.release.version = stackInfo.getVersion();
+    xml.release.releaseNotes = "NONE";
+    xml.release.display = stackId.toString();
+
+    for (ServiceInfo si : stackInfo.getServices()) {
+      ManifestService ms = new ManifestService();
+      ms.serviceName = si.getName();
+      ms.version = StringUtils.trimToEmpty(si.getVersion());
+      ms.serviceId = ms.serviceName + "-" + ms.version.replace(".", "");
+      xml.manifestServices.add(ms);
+    }
+
+    if (null != stackInfo.getRepositoryXml()) {
+      xml.repositoryInfo.getOses().addAll(stackInfo.getRepositoryXml().getOses());
+    }
+
+    try {
+      xml.toXml();
+    } catch (Exception e) {
+      throw new IllegalArgumentException(e);
+    }
+
+    return xml;
+  }
+
+  /**
    * Used to facilitate merging when multiple version definitions are provided.  Ambari
    * represents them as a unified entity.  Since there is no knowledge of which one is
    * "correct" - the first one is used for the release meta-info.
@@ -363,7 +420,6 @@ public class VersionDefinitionXml {
     public VersionDefinitionXml merge() {
       return m_seeded ? m_xml : null;
     }
-
   }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/392e57dc/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
index fc2bab1..a332308 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java
@@ -164,7 +164,6 @@ public class LatestRepoCallable implements Callable<Void> {
 
     // !!! each key is a version number, and the value is a map containing
     // os_family -> VDF link
-    VersionDefinitionXml.Merger merger = new VersionDefinitionXml.Merger();
 
     for (Entry<String, Object> entry : versionMap.entrySet()) {
       String version = entry.getKey();
@@ -172,34 +171,51 @@ public class LatestRepoCallable implements Callable<Void> {
       @SuppressWarnings("unchecked")
       Map<String, String> osMap = (Map<String, String>) entry.getValue();
 
-      for (Entry<String, String> versionEntry : osMap.entrySet()) {
-        String uriString = versionEntry.getValue();
+      VersionDefinitionXml xml = mergeDefinitions(stackId, version, osMap);
 
-        if ('.' == uriString.charAt(0)) {
-          uriString = new File(stackRepoFolder, uriString).toURI().toString();
-        }
+      if (null != xml) {
+        stack.addVersionDefinition(version, xml);
+      }
+    }
 
-        try {
-          URI uri = new URI(uriString);
+    return null;
+  }
+
+  /**
+   * Merges definitions loaded from the common file
+   * @param stackId the stack id
+   * @param version the version string
+   * @param osMap   the map containing all the VDF for an OS
+   * @return the merged version definition
+   * @throws Exception
+   */
+  private VersionDefinitionXml mergeDefinitions(StackId stackId, String version, Map<String,
String> osMap) throws Exception {
+    VersionDefinitionXml.Merger merger = new VersionDefinitionXml.Merger();
 
-          VersionDefinitionXml xml = VersionDefinitionXml.load(uri.toURL());
+    for (Entry<String, String> versionEntry : osMap.entrySet()) {
+      String uriString = versionEntry.getValue();
 
-          merger.add(version, xml);
-        } catch (Exception e) {
-          LOG.warn("Could not load version definition for {} identified by {}. {}",
-              stackId, uriString, e.getMessage(), e);
-        }
+      if ('.' == uriString.charAt(0)) {
+        uriString = new File(stackRepoFolder, uriString).toURI().toString();
       }
 
-      VersionDefinitionXml xml = merger.merge();
-      if (null != xml) {
-        stack.addVersionDefinition(version, xml);
+      try {
+        URI uri = new URI(uriString);
+
+        VersionDefinitionXml xml = VersionDefinitionXml.load(uri.toURL());
+
+        merger.add(version, xml);
+      } catch (Exception e) {
+        LOG.warn("Could not load version definition for {} identified by {}. {}",
+            stackId, uriString, e.getMessage(), e);
       }
     }
 
-    return null;
+    return merger.merge();
   }
 
+
+
   /**
    * Resolves a base url given that certain OS types can be used interchangeably.
    * @param os the target os to find

http://git-wip-us.apache.org/repos/asf/ambari/blob/392e57dc/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProviderTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProviderTest.java
index 1117d24..9f7a90f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/VersionDefinitionResourceProviderTest.java
@@ -269,11 +269,23 @@ public class VersionDefinitionResourceProviderTest {
         VersionDefinitionResourceProvider.SHOW_AVAILABLE).equals("true").toPredicate();
 
     Set<Resource> results = versionProvider.getResources(getRequest, predicate);
-    Assert.assertEquals(1, results.size());
+    Assert.assertEquals(2, results.size());
+
+    boolean found1 = false;
+    boolean found2 = false;
+    for (Resource res : results) {
+      if ("HDP-2.2.0-2.2.1.0".equals(res.getPropertyValue("VersionDefinition/id"))) {
+        Assert.assertEquals(Boolean.FALSE, res.getPropertyValue("VersionDefinition/stack_default"));
+        found1 = true;
+      } else if ("HDP-2.2.0".equals(res.getPropertyValue("VersionDefinition/id"))) {
+        Assert.assertEquals(Boolean.TRUE, res.getPropertyValue("VersionDefinition/stack_default"));
+        found2 = true;
+      }
+    }
 
-    Resource res = results.iterator().next();
+    Assert.assertTrue(found1);
+    Assert.assertTrue(found2);
 
-    Assert.assertEquals("HDP-2.2.0-2.2.1.0", res.getPropertyValue("VersionDefinition/id"));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/ambari/blob/392e57dc/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
index 929364c..9135732 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/events/listeners/upgrade/HostVersionOutOfSyncListenerTest.java
@@ -443,7 +443,7 @@ public class HostVersionOutOfSyncListenerTest {
 
     Map<String, String> hostAttributes = new HashMap<String, String>();
     hostAttributes.put("os_family", "redhat");
-    hostAttributes.put("os_release_version", "5.9");
+    hostAttributes.put("os_release_version", "6.4");
     host1.setHostAttributes(hostAttributes);
 
     host1.persist();

http://git-wip-us.apache.org/repos/asf/ambari/blob/392e57dc/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
index 7c45ecd..e7cbd99 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/ClusterTest.java
@@ -1884,7 +1884,7 @@ public class ClusterTest {
 
     Map<String, String> hostAttributes = new HashMap<String, String>();
     hostAttributes.put("os_family", "redhat");
-    hostAttributes.put("os_release_version", "5.9");
+    hostAttributes.put("os_release_version", "6.4");
 
     Cluster cluster = createClusterForRU(clusterName, stackId, hostAttributes);
 
@@ -2044,7 +2044,7 @@ public class ClusterTest {
 
     Map<String, String> hostAttributes = new HashMap<String, String>();
     hostAttributes.put("os_family", "redhat");
-    hostAttributes.put("os_release_version", "5.9");
+    hostAttributes.put("os_release_version", "6.4");
 
     Cluster cluster = createClusterForRU(clusterName, stackId, hostAttributes);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/392e57dc/ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml b/ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml
index 2a939f1..207d258 100644
--- a/ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml
+++ b/ambari-server/src/test/resources/stacks/HDP/2.2.0/repos/repoinfo.xml
@@ -17,20 +17,6 @@
 -->
 <reposinfo>
   <latest>./hdp.json</latest>
-  <os family="centos6">
-    <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.0.0</baseurl>
-      <repoid>HDP-2.2.0</repoid>
-      <reponame>HDP</reponame>
-    </repo>
-  </os>
-  <os family="centos5">
-    <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0</baseurl>
-      <repoid>HDP-2.2.0</repoid>
-      <reponame>HDP</reponame>
-    </repo>
-  </os>
   <os family="redhat6">
     <repo>
       <baseurl>http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.2.0.0</baseurl>
@@ -38,13 +24,6 @@
       <reponame>HDP</reponame>
     </repo>
   </os>
-  <os family="redhat5">
-    <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0</baseurl>
-      <repoid>HDP-2.2.0</repoid>
-      <reponame>HDP</reponame>
-    </repo>
-  </os>
   <os family="suse11">
     <repo>
       <baseurl>http://public-repo-1.hortonworks.com/HDP/suse11/2.x/updates/2.2.0.0</baseurl>
@@ -52,11 +31,4 @@
       <reponame>HDP</reponame>
     </repo>
   </os>
-  <os family="sles11">
-    <repo>
-      <baseurl>http://public-repo-1.hortonworks.com/HDP/suse11/2.x/updates/2.2.0.0</baseurl>
-      <repoid>HDP-2.2.0</repoid>
-      <reponame>HDP</reponame>
-    </repo>
-  </os>
 </reposinfo>


Mime
View raw message