ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [2/2] ambari git commit: AMBARI-17163. Wildcards shouldn't be used for package installation (aonishuk)
Date Fri, 10 Jun 2016 12:17:57 GMT
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 <aonishuk@hortonworks.com>
Authored: Fri Jun 10 15:17:38 2016 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
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 <stack-selector-tool> has not yet been done (situations like first install),
     # we can use <stack-selector-tool> 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 <stack-selector-tool>,
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)


Mime
View raw message