AMBARI-12466. Manual upgrade should fix some of the templeton properties in 
webhcat.(vbrodetskyi)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/cc8f7477
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/cc8f7477
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/cc8f7477

Branch: refs/heads/branch-2.1
Commit: cc8f74776bea30df631dd93f10e87915a6b0b4a5
Parents: e3e3d5c
Author: Vitaly Brodetskyi <vbrodets...@hortonworks.com>
Authored: Tue Jul 21 13:07:27 2015 +0300
Committer: Vitaly Brodetskyi <vbrodets...@hortonworks.com>
Committed: Tue Jul 21 13:07:27 2015 +0300

----------------------------------------------------------------------
 ambari-server/src/main/python/upgradeHelper.py  |   44 +-
 .../catalog/UpgradeCatalog_2.2_to_2.3.json      | 3848 ++++++++++--------
 2 files changed, 2141 insertions(+), 1751 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cc8f7477/ambari-server/src/main/python/upgradeHelper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/upgradeHelper.py 
b/ambari-server/src/main/python/upgradeHelper.py
index cc760ab..c38ce5f 100644
--- a/ambari-server/src/main/python/upgradeHelper.py
+++ b/ambari-server/src/main/python/upgradeHelper.py
@@ -160,6 +160,10 @@ class CatalogNotFoundException(Exception):
   pass
 
 
+class TemplateProcessingException(Exception):
+  pass
+
+
 class CatalogExistException(Exception):
   pass
 
@@ -501,12 +505,15 @@ class UpgradeCatalog(object):
     if CatConst.TEMPLATE_HANDLER in self._handlers and self._handlers is not 
None and \
                     CatConst.VALUE_TEMPLATE_TAG in catalog_property_item and 
catalog_property_item[
       CatConst.VALUE_TEMPLATE_TAG] == CatConst.TRUE_TAG:
-      parsed_value = self._handlers[CatConst.TEMPLATE_HANDLER](
-        self,
-        
self._search_pattern.findall(catalog_property_item[CatConst.PROPERTY_VALUE_TAG]),
-        catalog_property_item[CatConst.PROPERTY_VALUE_TAG]
-      )
-      catalog_property_item[CatConst.PROPERTY_VALUE_TAG] = parsed_value
+      try:
+        parsed_value = self._handlers[CatConst.TEMPLATE_HANDLER](
+          self,
+          
self._search_pattern.findall(catalog_property_item[CatConst.PROPERTY_VALUE_TAG]),
+          catalog_property_item[CatConst.PROPERTY_VALUE_TAG]
+        )
+        catalog_property_item[CatConst.PROPERTY_VALUE_TAG] = parsed_value
+      except TemplateProcessingException:
+        pass
 
   def __handle_add_new(self, catalog_item_name, catalog_property_item, 
properties):
     """
@@ -691,13 +698,15 @@ class ServerConfigFactory(object):
     """
     if CatConst.VALUE_TEMPLATE_TAG in item and CatConst.TEMPLATE_HANDLER in 
catalog.action_handlers and\
             CatConst.PROPERTY_DEFAULT in item and 
item[CatConst.VALUE_TEMPLATE_TAG] == CatConst.TRUE_TAG:
-
-      parsed_value = catalog.action_handlers[CatConst.TEMPLATE_HANDLER](
-        catalog,
-        catalog.tag_search_pattern.findall(item[CatConst.PROPERTY_DEFAULT]),
-        item[CatConst.PROPERTY_DEFAULT]
-      )
-      item[CatConst.PROPERTY_DEFAULT] = parsed_value
+      try:
+        parsed_value = catalog.action_handlers[CatConst.TEMPLATE_HANDLER](
+          catalog,
+          catalog.tag_search_pattern.findall(item[CatConst.PROPERTY_DEFAULT]),
+          item[CatConst.PROPERTY_DEFAULT]
+        )
+        item[CatConst.PROPERTY_DEFAULT] = parsed_value
+      except TemplateProcessingException:
+        pass
 
   def _process_property_value_transformation(self, catalog, 
property_map_definition, old_value):
     """
@@ -1105,9 +1114,16 @@ def get_zookeeper_quorum():
 
   return ",".join(zoo_quorum)
 
+
 def get_tez_history_url_base():
-  tez_view = curl(Options.TEZ_VIEW_URL, validate=False, simulate=False, 
parse=True)
+  try:
+    tez_view = curl(Options.TEZ_VIEW_URL, validate=False, simulate=False, 
parse=True)
+  except HTTPError as e:
+    raise TemplateProcessingException(str(e))
+
   version = ""
+
+
   if "versions" in tez_view and \
     len(tez_view['versions']) > 0 and \
     "ViewVersionInfo" in tez_view['versions'][0] and \

Reply via email to