From: Serge Rehbinder Date: Wed, 16 Nov 2016 10:29:10 +0000 (+0100) Subject: fix error message when no section was found for a product X-Git-Tag: 5.0.0a1~46 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=32efcacccf10ca4baaab771b25f9590c4b1ef3df;p=tools%2Fsat.git fix error message when no section was found for a product --- 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