Salome HOME
do not write sat-product.pyconf if config is not complete (case of archives) 5.2.0 V9_2_0
authorcrouzet <nicolas.crouzet@cea.fr>
Fri, 14 Dec 2018 16:23:42 +0000 (17:23 +0100)
committercrouzet <nicolas.crouzet@cea.fr>
Fri, 14 Dec 2018 16:23:42 +0000 (17:23 +0100)
src/product.py

index f1fa34be852d349016ef7dd4e63a907164fe7433..a06b5b814fc97d7ba608dcebf663d11a0f37edee 100644 (file)
@@ -484,7 +484,14 @@ def add_compile_config_file(p_info, config):
     aFile = os.path.join(p_info.install_dir, PRODUCT_FILENAME)
     with open(aFile, 'w') as f:
       # f.write(DBG.getStrConfigDbg(p_info)) # debug mode
-      p_info.__save__(f, evaluated=True) # evaluated expressions mode
+      try:
+          p_info.__save__(f, evaluated=True) # evaluated expressions mode
+      except:
+          # the second file is not mandatory. In the context of non VCS archives, p_info cannot be evaluated
+          # because information on git server is not available.  In this case, we skip the writing without raising an error.
+          #DBG.write("cannot evaluate product info - do not write ", PRODUCT_FILENAME, True)
+          pass
+          
 
 
 def check_config_exists(config, prod_dir, prod_info, verbose=False):