incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [23/50] git commit: [#3154] ticket:395 added project metadata to bulk export task
Date Wed, 21 Aug 2013 20:12:39 GMT
[#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 <mind1master@gmail.com>
Authored: Thu Jul 25 13:46:28 2013 +0300
Committer: Dave Brondsema <dbrondsema@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)


Mime
View raw message