瀏覽代碼

HUE-5069 [core] Running imported workflow fails across users

When a doc created by user1 is imported by user2, user2 doesn't have
acess to the workflow deployment_dir. In this case this fix will
be creating a new deployement_dir.
krish 9 年之前
父節點
當前提交
99b2921
共有 2 個文件被更改,包括 9 次插入1 次删除
  1. 2 0
      apps/oozie/src/oozie/tests.py
  2. 7 1
      desktop/libs/liboozie/src/liboozie/submission2.py

文件差異過大導致無法顯示
+ 2 - 0
apps/oozie/src/oozie/tests.py


+ 7 - 1
desktop/libs/liboozie/src/liboozie/submission2.py

@@ -307,8 +307,14 @@ STORED AS TEXTFILE %s""" % (self.properties.get('send_result_path'), '\n\n\n'.jo
     # Automatic setup of the required directories if needed
     create_directories(self.fs)
 
+    # Check if job owner owns the deployment directory.
+    has_deployment_dir_access = True
+    if self.job.deployment_dir:
+      statbuf = self.fs.stats(self.job.deployment_dir)
+      has_deployment_dir_access = statbuf and (statbuf.user == self.job.user.username)
+
     # Case of a shared job
-    if self.job.document and self.user != self.job.document.owner:
+    if self.job.document and self.user != self.job.document.owner or not has_deployment_dir_access:
       path = REMOTE_DEPLOYMENT_DIR.get().replace('$USER', self.user.username).replace('$TIME', str(time.time())).replace('$JOBID', str(self.job.id))
       # Shared coords or bundles might not have any existing workspaces
       if self.fs.exists(self.job.deployment_dir):

部分文件因文件數量過多而無法顯示