Skip to content

Commit

Permalink
fix for package search not returning correct packages
Browse files Browse the repository at this point in the history
Pulp's package api expects regular expressions when filtering by name.
  • Loading branch information
Tomas Strachota committed Feb 12, 2012
1 parent f1319cc commit 131c703
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/resources/pulp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,14 @@ def packages repo_id
end

def packages_by_name repo_id, name
response = get(repository_path + repo_id + "/packages/?name=" + name, self.default_headers)
response = get(repository_path + repo_id + "/packages/?name=^" + name + "$", self.default_headers)
body = response.body
JSON.parse(body)
end

def packages_by_nvre repo_id, name, version, release, epoch
#TODO: switch to https://fedorahosted.org/pulp/wiki/UGREST-Repositories#GetPackageByNVREA
path = repository_path + repo_id + "/packages/?name=" + name
path = repository_path + repo_id + "/packages/?name=^" + name +"$"
path += "&release=" + release if not release.nil?
path += "&version=" + version if not version.nil?
path += "&epoch=" + epoch if not epoch.nil?
Expand Down

0 comments on commit 131c703

Please sign in to comment.