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/03/29 17:55:36 UTC

[07/14] git commit: Check if the document to import has trackers or is just a list of tickets

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/5978
Commit: 5a3ff203beeab56516d812886a74a3a8a61893d4
Parents: 5c07930
Author: Jon Schewe <jp...@mtu.net>
Authored: Tue Mar 26 18:30:15 2013 -0500
Committer: Cory Johns <cj...@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)