浏览代码

AMBARI-8097. Upgrade to 1.7.0 shows exception in log related to WEBHCAT (aonishuk)

Andrew Onishuk 10 年之前
父节点
当前提交
5eb44e3625

+ 5 - 0
ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java

@@ -566,6 +566,11 @@ public class StackExtensionHelper {
           
           File alertsJson = new File(serviceFolder.getAbsolutePath() +
               File.separator + AmbariMetaInfo.SERVICE_ALERT_FILE_NAME);
+          
+          if (!metainfoFile.exists()) {
+            LOG.warn("Service folder " + serviceFolder.getAbsolutePath() + " doesn't contain metainfo file. Ignoring it.");
+            continue;
+          }
 
           //Reading v2 service metainfo (may contain multiple services)
           // Get services from metadata