ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [32/50] [abbrv] ambari git commit: AMBARI-19843. Publish asset has issues when different users logins (Madhan Mohan Reddy via gauravn7)
Date Fri, 03 Feb 2017 14:53:36 GMT
AMBARI-19843. Publish asset has issues when different users logins (Madhan Mohan Reddy via
gauravn7)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 0b472f2e2efbe1d1b2c2dc78c7442d59237edf2a
Parents: b5ee4c5
Author: Gaurav Nagar <grvngr@gmail.com>
Authored: Thu Feb 2 18:15:52 2017 +0530
Committer: Gaurav Nagar <grvngr@gmail.com>
Committed: Thu Feb 2 18:15:52 2017 +0530

----------------------------------------------------------------------
 .../java/org/apache/oozie/ambari/view/assets/AssetResource.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0b472f2e/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/assets/AssetResource.java
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/assets/AssetResource.java
b/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/assets/AssetResource.java
index af86810..ef3b508 100644
--- a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/assets/AssetResource.java
+++ b/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/assets/AssetResource.java
@@ -115,7 +115,7 @@ public class AssetResource {
     String workflowXml = oozieUtils.generateWorkflowXml(postBody);
     try {
       Map<String, String> result = new HashMap<>();
-      String tempWfPath = "/tmp" + "/tmpooziewfs/tempwf.xml";
+      String tempWfPath = "/tmp" + "/tmpooziewfs/tempwf_" + Math.round(Math.random()*100000)
+ ".xml";
       hdfsFileUtils.writeToFile(tempWfPath, workflowXml, true);
       queryParams.put("oozieparam.action", getAsList("dryrun"));
       queryParams.put("oozieconfig.rerunOnFailure", getAsList("false"));
@@ -125,6 +125,7 @@ public class AssetResource {
         tempWfPath, queryParams, JobType.WORKFLOW);
       LOGGER.info(String.format("resp from validating asset=[%s]",
         dryRunResp));
+      hdfsFileUtils.deleteFile(tempWfPath);
       if (dryRunResp != null && dryRunResp.trim().startsWith("{")) {
         JsonElement jsonElement = new JsonParser().parse(dryRunResp);
         JsonElement idElem = jsonElement.getAsJsonObject().get("id");


Mime
View raw message