Repository: ambari Updated Branches: refs/heads/trunk eb6ed77ce -> 0b641b8d7
AMBARI-5369. Ubuntu. Can't start deploy due to repo validation by server is failed (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0b641b8d Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0b641b8d Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0b641b8d Branch: refs/heads/trunk Commit: 0b641b8d73a0ad63db7d8d3382d22d1393e9ac1d Parents: eb6ed77 Author: Andrew Onischuk <[email protected]> Authored: Wed Apr 9 04:11:49 2014 -0700 Committer: Andrew Onischuk <[email protected]> Committed: Wed Apr 9 04:11:49 2014 -0700 ---------------------------------------------------------------------- .../libraries/script/repo_installer.py | 6 +++++- .../server/configuration/Configuration.java | 22 ++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0b641b8d/ambari-agent/src/main/python/resource_management/libraries/script/repo_installer.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/python/resource_management/libraries/script/repo_installer.py b/ambari-agent/src/main/python/resource_management/libraries/script/repo_installer.py index e3a5aea..082aaea 100644 --- a/ambari-agent/src/main/python/resource_management/libraries/script/repo_installer.py +++ b/ambari-agent/src/main/python/resource_management/libraries/script/repo_installer.py @@ -20,6 +20,8 @@ limitations under the License. import json from resource_management.libraries.resources.repository import Repository +UBUNTU_REPO_COMPONENTS = ["HDP", "main"] + class RepoInstaller(): @classmethod def install_repos(cls, config): @@ -56,4 +58,6 @@ class RepoInstaller(): action = action, base_url = repo['baseUrl'], mirror_list = repo['mirrorsList'], - repo_file_name = repo['repoName']) \ No newline at end of file + repo_file_name = repo['repoName'], + components = UBUNTU_REPO_COMPONENTS, # ubuntu specific + ) http://git-wip-us.apache.org/repos/asf/ambari/blob/0b641b8d/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 1fed357..2b7fa14 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 @@ -263,10 +263,14 @@ public class Configuration { private static final String SERVER_PERSISTENCE_TYPE_DEFAULT = "local"; private static final String SERVER_CONNECTION_MAX_IDLE_TIME = "server.connection.max.idle.millis"; + + private static final String UBUNTU_OS = "debian12"; + /** * 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 PARALLEL_STAGE_EXECUTION_DEFAULT = "true"; private static final Logger LOG = LoggerFactory.getLogger( Configuration.class); @@ -890,8 +894,22 @@ public class Configuration { * @return a string array of suffixes used to validate repo URLs. */ public String[] getRepoValidationSuffixes() { - String value = properties.getProperty(REPO_SUFFIX_KEY, - REPO_SUFFIX_DEFAULT); + String osType = getServerOsType(); + + if (osType == null || osType.isEmpty()) { + throw new RuntimeException(Configuration.OS_VERSION_KEY + " is not " + + " set in the ambari.properties file"); + } + + String value = null; + + if(osType.equals(UBUNTU_OS)) { + value = properties.getProperty(REPO_SUFFIX_KEY, + REPO_SUFFIX_UBUNTU); + } else { + value = properties.getProperty(REPO_SUFFIX_KEY, + REPO_SUFFIX_DEFAULT); + } return value.split(","); }
