Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C8421200B2A for ; Fri, 10 Jun 2016 14:17:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C7080160A04; Fri, 10 Jun 2016 12:17:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 22393160A38 for ; Fri, 10 Jun 2016 14:17:56 +0200 (CEST) Received: (qmail 24483 invoked by uid 500); 10 Jun 2016 12:17:56 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 24457 invoked by uid 99); 10 Jun 2016 12:17:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Jun 2016 12:17:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 31297E01BD; Fri, 10 Jun 2016 12:17:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aonishuk@apache.org To: commits@ambari.apache.org Date: Fri, 10 Jun 2016 12:17:57 -0000 Message-Id: <6839478e25b740ea9b6d0e4030d6b332@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] ambari git commit: AMBARI-17163. Wildcards shouldn't be used for package installation (aonishuk) archived-at: Fri, 10 Jun 2016 12:17:57 -0000 AMBARI-17163. Wildcards shouldn't be used for package installation (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/30e9259f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/30e9259f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/30e9259f Branch: refs/heads/branch-2.4 Commit: 30e9259fdfc60d86b17ea2a7a65331780cbe2460 Parents: ca47b16 Author: Andrew Onishuk Authored: Fri Jun 10 15:17:38 2016 +0300 Committer: Andrew Onishuk Committed: Fri Jun 10 15:17:38 2016 +0300 ---------------------------------------------------------------------- .../resource_management/libraries/script/script.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/30e9259f/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 d11fb13..49dcb4e 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 @@ -313,10 +313,13 @@ class Script(object): # If has not yet been done (situations like first install), # we can use version itself. - if not Script.stack_version_from_distro_select: + # Wildcards cause a lot of troubles with installing packages, if the version contains wildcards we should try to specify it. + if not Script.stack_version_from_distro_select or '*' in Script.stack_version_from_distro_select: + # FIXME: this method is not reliable to get stack-selector-version + # as if there are multiple versions installed with different , we won't detect the older one (if needed). Script.stack_version_from_distro_select = packages_analyzer.getInstalledPackageVersion( stack_tools.get_stack_tool_package(stack_tools.STACK_SELECTOR_NAME)) - + return Script.stack_version_from_distro_select def format_package_name(self, name): @@ -338,7 +341,9 @@ class Script(object): stack_version_package_formatted = package_version if OSCheck.is_ubuntu_family(): stack_version_package_formatted = package_version.replace('_', package_delimiter) - else: + + # Wildcards cause a lot of troubles with installing packages, if the version contains wildcards we try to specify it. + if not package_version or '*' in package_version: stack_version_package_formatted = self.get_stack_version_before_packages_installed().replace('.', package_delimiter).replace('-', package_delimiter) if STACK_VERSION_PLACEHOLDER in name else name package_name = name.replace(STACK_VERSION_PLACEHOLDER, stack_version_package_formatted)