You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2016/06/10 12:17:56 UTC

[1/2] ambari git commit: AMBARI-17163. Wildcards shouldn't be used for package installation (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 ca47b1608 -> 30e9259fd
  refs/heads/trunk 9380b2931 -> d58382a87


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/d58382a8
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d58382a8
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d58382a8

Branch: refs/heads/trunk
Commit: d58382a877ba1b6f5ca210c5cad961cd24586038
Parents: 9380b29
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Fri Jun 10 15:17:35 2016 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Fri Jun 10 15:17:35 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/d58382a8/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)


[2/2] ambari git commit: AMBARI-17163. Wildcards shouldn't be used for package installation (aonishuk)

Posted by ao...@apache.org.
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 <ao...@hortonworks.com>
Authored: Fri Jun 10 15:17:38 2016 +0300
Committer: Andrew Onishuk <ao...@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)