From 32efcacccf10ca4baaab771b25f9590c4b1ef3df Mon Sep 17 00:00:00 2001 From: Serge Rehbinder Date: Wed, 16 Nov 2016 11:29:10 +0100 Subject: [PATCH] fix error message when no section was found for a product --- src/product.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/product.py b/src/product.py index f51b518..c1cf33b 100644 --- a/src/product.py +++ b/src/product.py @@ -132,8 +132,16 @@ def get_product_config(config, product_name, with_install_dir=True): # If prod_info is still None, it means that there is no product definition # in the config. The user has to provide it. if prod_info is None: - msg = _("No definition found for the product %s\n" - "Please create a %s.pyconf file." % (product_name, product_name)) + prod_pyconf_path = src.find_file_in_lpath(product_name + ".pyconf", + config.PATHS.PRODUCTPATH) + if not prod_pyconf_path: + msg = _("No definition found for the product %s\n" + "Please create a %s.pyconf file." % (product_name, product_name)) + else: + msg = _("No definition corresponding to the version %(version)s was" + " found in the file %(prod_file_path)s.\nPlease add a " + "section in it." % {"version" : vv, + "prod_file_path" : prod_pyconf_path} ) raise src.SatException(msg) # Set the debug, dev and version keys -- 2.39.2