You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/08/23 18:58:21 UTC
[21/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/154814e7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/154814e7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/154814e7
Branch: refs/heads/cj/6530
Commit: 154814e782a36f451844eeeb92a7be145cec7064
Parents: 4100da6
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Thu Jul 25 13:46:28 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Aug 22 20:04:43 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/154814e7/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)