]> git.ozlabs.org Git - patchwork/commitdiff
pwclient: Get rid of underscore to dash replacement
authorNate Case <ncase@xes-inc.com>
Wed, 10 Sep 2008 22:14:33 +0000 (17:14 -0500)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 11 Sep 2008 06:47:09 +0000 (16:47 +1000)
I was erroneously doing some string substitutions so that it
would find project names with an underscore in the name.  It
was only necessary due to a side effect of a bug fixed in commit
35241d528c3699b982730a333e236d57dc6451b6 (find project by linkname,
not full name).  In my test case, I had an underscore in the linkname,
but a dash in the full name.

No such string replacement is necessary, and actually breaks
filtering by projects with an underscore in the name now that
we're searching by linkname properly.

Signed-off-by: Nate Case <ncase@xes-inc.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
apps/patchwork/bin/pwclient

index 9b352400e674f3b6cd00beab46b6302ae060bcb1..e25212a8a4088c4def4f608071e971c63db997e9 100755 (executable)
@@ -128,11 +128,9 @@ def project_id_by_name(rpc, linkname):
     """Given a project short name, look up the Project ID."""
     if len(linkname) == 0:
         return 0
-    # The search requires - instead of _
-    search = linkname.replace("_", "-")
-    projects = rpc.project_list(search, 0)
+    projects = rpc.project_list(linkname, 0)
     for project in projects:
-        if project['linkname'].replace("_", "-") == search:
+        if project['linkname'] == linkname:
             return project['id']
     return 0
 
@@ -205,7 +203,7 @@ def action_projects(rpc):
     print("%-5s %-24s %s" % ("--", "----", "-----------"))
     for project in projects:
         print("%-5d %-24s %s" % (project['id'], \
-                project['linkname'].replace("_", "-"), \
+                project['linkname'], \
                 project['name']))
 
 def action_states(rpc):