ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject git commit: AMBARI-6238. Repo validation for HDP-UTILS fails on ubuntu (aonishuk)
Date Mon, 23 Jun 2014 14:57:54 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 7d9d45253 -> 0f6533588


AMBARI-6238. Repo validation for HDP-UTILS fails on ubuntu (aonishuk)


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

Branch: refs/heads/trunk
Commit: 0f653358807da358010f0ad6eca6e6e52f98aefb
Parents: 7d9d452
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Mon Jun 23 17:57:46 2014 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Mon Jun 23 17:57:46 2014 +0300

----------------------------------------------------------------------
 .../org/apache/ambari/server/configuration/Configuration.java | 2 +-
 .../server/controller/AmbariManagementControllerImpl.java     | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0f653358/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
index a856c6e..226cf86 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
@@ -276,7 +276,7 @@ public class Configuration {
    * Default for repo validation suffixes.
    */
   private static final String REPO_SUFFIX_DEFAULT = "/repodata/repomd.xml";
-  private static final String REPO_SUFFIX_UBUNTU = "/dists/HDP/Release.gpg,/dists/HDP/Release";
+  private static final String REPO_SUFFIX_UBUNTU = "/dists/%s/Release.gpg,/dists/%s/Release";
   
   private static final String PARALLEL_STAGE_EXECUTION_DEFAULT = "true";
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/0f653358/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 63714e3..4129091 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
@@ -2701,7 +2701,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
       
       if (null == rr.getRepoId() || rr.getRepoId().isEmpty())
         throw new AmbariException("Repo ID must be specified.");
-      
+
       if (null != rr.getBaseUrl()) {
         if (!rr.isVerifyBaseUrl()) {
           ambariMetaInfo.updateRepoBaseURL(rr.getStackName(),
@@ -2710,12 +2710,15 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
         } else {
           URLStreamProvider usp = new URLStreamProvider(REPO_URL_CONNECT_TIMEOUT,
               REPO_URL_READ_TIMEOUT, null, null, null);
+          
+          RepositoryInfo repositoryInfo = ambariMetaInfo.getRepository(rr.getStackName(),
rr.getStackVersion(), rr.getOsType(), rr.getRepoId());
+          String repoName = repositoryInfo.getRepoName();
 
           boolean bFound = false;
           
           String[] suffixes = configs.getRepoValidationSuffixes(rr.getOsType());
           for (int i = 0; i < suffixes.length && !bFound; i++) {
-            String suffix = suffixes[i];
+            String suffix = String.format(suffixes[i], repoName);
             String spec = rr.getBaseUrl();
             
             if (spec.charAt(spec.length()-1) != '/' && suffix.charAt(0) != '/')


Mime
View raw message