Browse Source

AMBARI-13082. Devdeploy: Hdfs components install fails with lzo enabled (aonishuk)

Andrew Onishuk 10 years ago
parent
commit
25de1567ac

+ 2 - 2
ambari-common/src/main/python/resource_management/libraries/functions/get_lzo_packages.py

@@ -39,9 +39,9 @@ def get_lzo_packages(stack_version_unformatted):
 
 
   if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
   if hdp_stack_version != "" and compare_versions(hdp_stack_version, '2.2') >= 0:
     if OSCheck.is_redhat_family() or OSCheck.is_suse_family():
     if OSCheck.is_redhat_family() or OSCheck.is_suse_family():
-      lzo_packages += [format("hadooplzo_{underscored_version}_.+")]
+      lzo_packages += [format("hadooplzo_{underscored_version}_*")]
     elif OSCheck.is_ubuntu_family():
     elif OSCheck.is_ubuntu_family():
-      lzo_packages += [format("hadooplzo_{dashed_version}_.+")]
+      lzo_packages += [format("hadooplzo_{dashed_version}_*")]
   else:
   else:
     lzo_packages += ["hadoop-lzo"]
     lzo_packages += ["hadoop-lzo"]
 
 

+ 5 - 3
ambari-common/src/main/python/resource_management/libraries/script/script.py

@@ -362,7 +362,8 @@ class Script(object):
     from this list
     from this list
     
     
     exclude_packages - list of regexes (possibly raw strings as well), the
     exclude_packages - list of regexes (possibly raw strings as well), the
-    packages which match the regex won't be installed
+    packages which match the regex won't be installed.
+    NOTE: regexes don't have Python syntax, but simple package regexes which support only * and .* and ?
     """
     """
     config = self.get_config()
     config = self.get_config()
     if 'host_sys_prepped' in config['hostLevelParams']:
     if 'host_sys_prepped' in config['hostLevelParams']:
@@ -401,8 +402,9 @@ class Script(object):
   @staticmethod
   @staticmethod
   def matches_any_regexp(string, regexp_list):
   def matches_any_regexp(string, regexp_list):
     for regex in regexp_list:
     for regex in regexp_list:
-      # adding ^ and $ to correctly match raw strings from begining to the end
-      if re.match('^' + regex + '$', string):
+      # we cannot use here Python regex, since * will create some troubles matching plaintext names. 
+      package_regex = '^' + re.escape(regex).replace('\\.\\*','.*').replace("\\?", ".").replace("\\*", ".*") + '$'
+      if re.match(package_regex, string):
         return True
         return True
     return False
     return False
 
 

+ 1 - 1
ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/package/scripts/params_linux.py

@@ -109,7 +109,7 @@ phoenix_hosts = default('/clusterHostInfo/phoenix_query_server_hosts', [])
 has_phoenix = len(phoenix_hosts) > 0
 has_phoenix = len(phoenix_hosts) > 0
 
 
 if not has_phoenix:
 if not has_phoenix:
-  exclude_packages = ['phoenix.+']
+  exclude_packages = ['phoenix*']
 else:
 else:
   exclude_packages = []
   exclude_packages = []