You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/08/21 22:12:39 UTC

[23/50] git commit: [#3154] ticket:395 added project metadata to bulk export task

[#3154] ticket:395 added project metadata to bulk export task


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

Branch: refs/heads/db/3154b
Commit: 0e35d495a9ac5dc46d5463e9c0176634312bdc55
Parents: a5ee64e
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Thu Jul 25 13:46:28 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 21 18:12:25 2013 +0000

----------------------------------------------------------------------
 Allura/allura/tasks/export_tasks.py | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0e35d495/Allura/allura/tasks/export_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/export_tasks.py b/Allura/allura/tasks/export_tasks.py
index 9001500..395970c 100644
--- a/Allura/allura/tasks/export_tasks.py
+++ b/Allura/allura/tasks/export_tasks.py
@@ -15,6 +15,7 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
+import json
 import os
 import logging
 import shutil
@@ -64,6 +65,13 @@ def bulk_export(project_shortname, tools, username):
             continue
 
     try:
+        path = create_export_dir(project)
+        with open(os.path.join(path, 'project.json'), 'w') as f:
+            json.dump(project, f, cls=tg.jsonify.GenericJSON)
+    except:
+        log.error('Something went wrong during export of project metadata', exc_info=True)
+
+    try:
         zip_and_cleanup(project)
     except:
         log.error('Something went wrong during zipping exported data.', exc_info=True)