incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [1/2] git commit: [#7114] Don't hardcode nbhd prefix
Date Fri, 07 Feb 2014 16:23:24 GMT
Updated Branches:
  refs/heads/master 07e206f1b -> d6fe461e7


[#7114] Don't hardcode nbhd prefix

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>


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

Branch: refs/heads/master
Commit: f62e5c963e9f4fef45635b6cd8b441ad89d072c7
Parents: 07e206f
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Tue Jan 28 21:36:57 2014 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Fri Feb 7 16:23:03 2014 +0000

----------------------------------------------------------------------
 Allura/allura/lib/import_api.py                     |  1 +
 ForgeTracker/forgetracker/scripts/import_tracker.py | 10 +++++++---
 scripts/allura_import.py                            |  7 ++++++-
 3 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f62e5c96/Allura/allura/lib/import_api.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/import_api.py b/Allura/allura/lib/import_api.py
index 9e383b5..d8159c5 100644
--- a/Allura/allura/lib/import_api.py
+++ b/Allura/allura/lib/import_api.py
@@ -57,6 +57,7 @@ class AlluraImportApiClient(object):
                 resp = result.read()
                 return json.loads(resp)
             except urllib2.HTTPError, e:
+                e.msg += ' ({0})'.format(url)
                 if self.verbose:
                     error_content = e.read()
                     e.msg += '. Error response:\n' + error_content

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f62e5c96/ForgeTracker/forgetracker/scripts/import_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/scripts/import_tracker.py b/ForgeTracker/forgetracker/scripts/import_tracker.py
index ba8e93f..965fafa 100644
--- a/ForgeTracker/forgetracker/scripts/import_tracker.py
+++ b/ForgeTracker/forgetracker/scripts/import_tracker.py
@@ -28,7 +28,12 @@ log = logging.getLogger(__name__)
 
 def import_tracker(cli, project, tool, import_options, doc_txt,
                    validate=True, verbose=False, cont=False):
-    url = '/rest/p/' + project + '/' + tool
+    from allura import model as M
+    p = M.Project.query.get(shortname=project)
+    url = '/rest/{project_url}/{tool}'.format(
+            project_url=p.url().strip('/'),
+            tool=tool,
+            )
     if validate:
         url += '/validate_import'
     else:
@@ -36,8 +41,7 @@ def import_tracker(cli, project, tool, import_options, doc_txt,
 
     existing_map = {}
     if cont:
-        existing_tickets = cli.call(
-            '/rest/p/' + project + '/' + tool + '/')['tickets']
+        existing_tickets = cli.call(url + '/')['tickets']
         for t in existing_tickets:
             existing_map[t['ticket_num']] = t['summary']
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f62e5c96/scripts/allura_import.py
----------------------------------------------------------------------
diff --git a/scripts/allura_import.py b/scripts/allura_import.py
index 56bc5d5..63d14f1 100644
--- a/scripts/allura_import.py
+++ b/scripts/allura_import.py
@@ -70,7 +70,12 @@ def main():
 
 
 def import_forum(cli, project, tool, user_map, doc_txt, validate=True):
-    url = '/rest/p/' + project + '/' + tool
+    from allura import model as M
+    p = M.Project.query.get(shortname=project)
+    url = '/rest/{project_url}/{tool}'.format(
+            project_url=p.url().strip('/'),
+            tool=tool,
+            )
     if validate:
         url += '/validate_import'
         print cli.call(url, doc=doc_txt, user_map=json.dumps(user_map))


Mime
View raw message