Repository: ambari Updated Branches: refs/heads/branch-2.6 d0d3c49f7 -> f961d8ecb
AMBARI-21995. Revise log message for component version not found (ncole) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f961d8ec Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f961d8ec Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f961d8ec Branch: refs/heads/branch-2.6 Commit: f961d8ecb192413c445d45e6976f999a6b7df1fb Parents: d0d3c49 Author: Nate Cole <[email protected]> Authored: Tue Sep 19 10:37:02 2017 -0400 Committer: Nate Cole <[email protected]> Committed: Tue Sep 19 11:38:10 2017 -0400 ---------------------------------------------------------------------- .../main/python/resource_management/libraries/script/script.py | 3 ++- .../server/controller/AmbariCustomCommandExecutionHelper.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/f961d8ec/ambari-common/src/main/python/resource_management/libraries/script/script.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/script/script.py b/ambari-common/src/main/python/resource_management/libraries/script/script.py index db7e116..5940166 100644 --- a/ambari-common/src/main/python/resource_management/libraries/script/script.py +++ b/ambari-common/src/main/python/resource_management/libraries/script/script.py @@ -228,7 +228,8 @@ class Script(object): if repo_version_id: self.put_structured_out({"repository_version_id": repo_version_id}) else: - Logger.error("Component '{0}' did not advertise a version. This may indicate a problem with the component packaging.".format(stack_select_package_name)) + if not self.is_hook(): + Logger.error("Component '{0}' did not advertise a version. This may indicate a problem with the component packaging.".format(stack_select_package_name)) def should_expose_component_version(self, command_name): http://git-wip-us.apache.org/repos/asf/ambari/blob/f961d8ec/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java index 1d0c44c..3c15d92 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java @@ -1470,7 +1470,8 @@ public class AmbariCustomCommandExecutionHelper { } Map<String, String> createDefaultHostParams(Cluster cluster, RepositoryVersionEntity repositoryVersion) throws AmbariException { - return createDefaultHostParams(cluster, repositoryVersion.getStackId()); + StackId stackId = (null == repositoryVersion) ? cluster.getDesiredStackVersion() : repositoryVersion.getStackId(); + return createDefaultHostParams(cluster, stackId); } Map<String, String> createDefaultHostParams(Cluster cluster, StackId stackId) throws AmbariException {
