allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [32/40] git commit: Check if the document to import has trackers or is just a list of tickets
Date Mon, 01 Apr 2013 14:27:51 GMT
Check if the document to import has trackers or is just a list of
tickets

When exporting with trac_export.py the tickets are the top level list of
objects in the JSON dump.


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

Branch: refs/heads/cj/5963
Commit: 5a3ff203beeab56516d812886a74a3a8a61893d4
Parents: 5c07930
Author: Jon Schewe <jpschewe@mtu.net>
Authored: Tue Mar 26 18:30:15 2013 -0500
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Thu Mar 28 20:42:12 2013 +0000

----------------------------------------------------------------------
 scripts/allura_import.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5a3ff203/scripts/allura_import.py
----------------------------------------------------------------------
diff --git a/scripts/allura_import.py b/scripts/allura_import.py
index 1dd151c..e6982b2 100644
--- a/scripts/allura_import.py
+++ b/scripts/allura_import.py
@@ -66,8 +66,13 @@ def import_tracker(cli, project, tool, import_options, options, doc_txt,
validat
             existing_map[t['ticket_num']] = t['summary']
 
     doc = json.loads(doc_txt)
-    tickets_in = doc['trackers']['default']['artifacts']
-    doc['trackers']['default']['artifacts'] = []
+
+    if 'trackers' in doc and 'default' in doc['trackers'] and 'artifacts' in doc['trackers']['default']:
+        tickets_in = doc['trackers']['default']['artifacts']
+        doc['trackers']['default']['artifacts'] = []
+    else:
+        tickets_in = doc
+        
     if options.verbose:
         print "Processing %d tickets" % len(tickets_in)
 


Mime
View raw message