diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/repository_util.py b/ambari-common/src/main/python/resource_management/libraries/functions/repository_util.py index 7faa33fcad1..7846dee6a7c 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/repository_util.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/repository_util.py @@ -21,6 +21,7 @@ from resource_management.core.exceptions import Fail from resource_management.core.logger import Logger from resource_management.libraries.resources.repository import Repository +from resource_management.libraries.functions.cluster_settings import get_cluster_setting_value from resource_management.libraries.functions.is_empty import is_empty import ambari_simplejson as json @@ -36,8 +37,8 @@ def __init__(self, config, tags_to_skip): # repo templates repo_file = config['repositoryFile'] - repo_rhel_suse = config['configurations']['cluster-env']['repo_suse_rhel_template'] - repo_ubuntu = config['configurations']['cluster-env']['repo_ubuntu_template'] + repo_rhel_suse = get_cluster_setting_value('repo_rhel_suse_template') + repo_ubuntu = get_cluster_setting_value('repo_ubuntu_template') if is_empty(repo_file): return diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/stack_features.py b/ambari-common/src/main/python/resource_management/libraries/functions/stack_features.py index 3e7331009bd..92a8383acbf 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/stack_features.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/stack_features.py @@ -83,7 +83,7 @@ def check_stack_feature(stack_feature, stack_version): return False return True else: - raise Fail("Stack features not defined by stack") + Logger.warning("Stack features not defined by stack") return False diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py b/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py index 6678588a1a8..a3f086d3138 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/stack_select.py @@ -129,6 +129,9 @@ def is_package_supported(package, supported_packages = None): """ if supported_packages is None: supported_packages = get_supported_packages() + if supported_packages is None: + Logger.warning('No stack tool available, all packages are assumed to be supported by this stack') + return True if package in supported_packages: return True @@ -142,6 +145,9 @@ def get_supported_packages(): :return: and array of packages support by """ stack_selector_path = stack_tools.get_stack_tool_path(stack_tools.STACK_SELECTOR_NAME) + if not os.path.exists(stack_selector_path): + Logger.warning('This stack does not have a stack select tool') + return command = (STACK_SELECT_PREFIX, stack_selector_path, "packages") code, stdout = shell.call(command, sudo = True, quiet = True)