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>
"""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
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):