Skip to content

Commit

Permalink
Merge pull request #53 from hlin/master
Browse files Browse the repository at this point in the history
Response 404 for module product listings not found error
  • Loading branch information
hlin authored Feb 22, 2019
2 parents 380466e + 6942e24 commit eb05732
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions product_listings_manager/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,18 +453,15 @@ def getModuleProductListings(productLabel, moduleNVR):
module_name = module['name']
module_stream = module['stream']
module_version = module['version']
except KeyError:
raise koji.GenericError("It's not a module build: %s" % moduleNVR)
except (KeyError, TypeError):
raise ProductListingsNotFoundError("It's not a module build: %s" % moduleNVR)

prodinfo = Products.get_product_info(compose_dbh, productLabel)
if not prodinfo:
# no product with the given label exists
raise koji.GenericError("Could not find a product with label: %s" % productLabel)
version, variants = prodinfo

module = Products.get_module(compose_dbh, module_name, module_stream, module_version)
if not module:
raise koji.GenericError("Could not find a module build with NVR: %s" % moduleNVR)
raise ProductListingsNotFoundError("Could not find a module build with NVR: %s" % moduleNVR)
module_id = module[0]

listings = {}
Expand Down

0 comments on commit eb05732

Please sign in to comment.