bhavikpatel9977 commented on code in PR #3824:
URL: https://github.com/apache/ambari/pull/3824#discussion_r1757955357


##########
ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java:
##########
@@ -860,4 +879,81 @@ ResourceInstance createArtifactResource(String 
clusterName, String artifactName)
 
     return createResource(Resource.Type.Artifact, mapIds);
   }
+
+  private boolean parseBody(String body) {
+    JsonObject jsonObject = gson.fromJson(body, JsonObject.class);
+    if (jsonObject == null) {
+      return false;
+    }
+
+    JsonElement artifact_data = jsonObject.get("artifact_data");
+    if (artifact_data == null) {
+      return false;
+    }
+    JsonArray identities = 
artifact_data.getAsJsonObject().getAsJsonArray("identities");
+    if (identities != null) {
+      if (checkKeytabsPrincipal(identities)) {
+        return true;
+      }
+    }
+
+    JsonArray services = 
artifact_data.getAsJsonObject().getAsJsonArray("services");

Review Comment:
   I've performed thorough analysis of the object structure to prevent 
NullPointerException, so we shouldn't encounter any issues. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to