瀏覽代碼

AMBARI-8098. Upgrade to 1.7.0 fails if Oozie was not installed with NPE (aonishuk)

Andrew Onishuk 10 年之前
父節點
當前提交
b7799aa935
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java

+ 2 - 1
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog170.java

@@ -1076,7 +1076,8 @@ public class UpgradeCatalog170 extends AbstractUpgradeCatalog {
           }
           }
 
 
           //oozie_heapsize is added for HDP2, we should check if it exists and not add it for HDP1
           //oozie_heapsize is added for HDP2, we should check if it exists and not add it for HDP1
-          if(cluster.getDesiredConfigByType("oozie-env").getProperties().containsKey("oozie_heapsize")) {
+          if(cluster.getDesiredConfigByType("oozie-env") != null &&
+              cluster.getDesiredConfigByType("oozie-env").getProperties().containsKey("oozie_heapsize")) {
             Map<String, String> oozieProps = new HashMap<String, String>();
             Map<String, String> oozieProps = new HashMap<String, String>();
             oozieProps.put("oozie_heapsize","2048m");
             oozieProps.put("oozie_heapsize","2048m");
             oozieProps.put("oozie_permsize","256m");
             oozieProps.put("oozie_permsize","256m");