浏览代码

[oozie] Support exporting workflows with credentials

Romain Rigaux 11 年之前
父节点
当前提交
0db0435
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      apps/oozie/src/oozie/views/editor.py

+ 8 - 1
apps/oozie/src/oozie/views/editor.py

@@ -237,7 +237,14 @@ def import_coordinator(request):
 
 @check_job_access_permission()
 def export_workflow(request, workflow):
-  zip_file = workflow.compress(mapping=dict([(param['name'], param['value']) for param in workflow.find_all_parameters()]))
+  mapping = dict([(param['name'], param['value']) for param in workflow.find_all_parameters()])
+
+  api = get_oozie(request.user)
+  credentials = Credentials()
+  credentials.fetch(api)
+  mapping['credentials'] = credentials.get_properties()
+
+  zip_file = workflow.compress(mapping=mapping)
 
   response = HttpResponse(mimetype="application/zip")
   response["Last-Modified"] = http_date(time.time())