incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [05/46] git commit: Create a new JSON object for the ticket to import
Date Wed, 03 Apr 2013 17:26:34 GMT
Create a new JSON object for the ticket to import

If the imported JSON object doesn't have the correct structure we need
to create it.


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

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

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


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e8161e69/scripts/allura_import.py
----------------------------------------------------------------------
diff --git a/scripts/allura_import.py b/scripts/allura_import.py
index e6982b2..60858ea 100644
--- a/scripts/allura_import.py
+++ b/scripts/allura_import.py
@@ -81,8 +81,11 @@ def import_tracker(cli, project, tool, import_options, options, doc_txt,
validat
                 if options.verbose:
                     print 'Ticket id %d already exists, skipping' % ticket_in['id']
                 continue
-            doc['trackers']['default']['artifacts'] = [ticket_in]
-            res = cli.call(url, doc=json.dumps(doc), options=json.dumps(import_options))
+            doc_import={}
+            doc_import['trackers'] = {}
+            doc_import['trackers']['default'] = {}
+            doc_import['trackers']['default']['artifacts'] = [ticket_in]
+            res = cli.call(url, doc=json.dumps(doc_import), options=json.dumps(import_options))
             assert res['status'] and not res['errors']
             if options.validate:
                 if res['warnings']:


Mime
View raw message