Przeglądaj źródła

AMBARI-6287. HDP-UTILS is not correctly fetched from the hdp_urlinfo.json for Ubuntu repos (aonishuk)

Andrew Onishuk 11 lat temu
rodzic
commit
18596f1b05

+ 9 - 1
ambari-server/src/main/java/org/apache/ambari/server/state/stack/LatestRepoCallable.java

@@ -104,7 +104,15 @@ public class LatestRepoCallable implements Callable<Void> {
             if (null != baseUrl) {
               // !!! in the case where <name>.repo is defined with the base url, strip that off.
               // Agents do the reverse action (take the base url, and append <name>.repo)
-              String repoFileName = stack.getName().toLowerCase() + ".repo";
+              
+              String repo_file_format;
+              if(ri.getOsType().equals("debian12")) {
+                repo_file_format = "list";
+              } else {
+                repo_file_format = "repo";
+              }
+              
+              String repoFileName = stack.getName().toLowerCase() + "." + repo_file_format;
               int idx = baseUrl.toLowerCase().indexOf(repoFileName); 
               
               if (-1 != idx && baseUrl.toLowerCase().endsWith(repoFileName)) {