From 0555320d0c62a5a95ce24227fa1a8079c87e8938 Mon Sep 17 00:00:00 2001
From: Daniel <d.hornung@indiscale.com>
Date: Mon, 25 Sep 2023 09:46:43 +0200
Subject: [PATCH] FIX: Fixed environment/inif file checks.

---
 src/linkahead/configuration.py | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/linkahead/configuration.py b/src/linkahead/configuration.py
index e47af23c..63ad2bff 100644
--- a/src/linkahead/configuration.py
+++ b/src/linkahead/configuration.py
@@ -113,17 +113,21 @@ def _read_config_files():
     return_var = []
     ini_user = expanduser('~/.pylinkahead.ini')
     ini_cwd = join(getcwd(), "pylinkahead.ini")
+    # LinkAhead rename block ##################################################
+    ini_user_caosdb = expanduser('~/.pycaosdb.ini')
+    ini_cwd_caosdb = join(getcwd(), "pycaosdb.ini")
     if "PYCAOSDBINI" in environ:
-        raise RuntimeError("You have set the old PYCAOSDBINI environment variable. Please use the "
-                           "new PYLINKAHEADINI variable instead and unset the old one.")
-    if os.path.exists(ini_user):
-        raise RuntimeError("You have a config file with the old naming scheme (pycaosdb.ini). "
+        raise RuntimeError("\n\nYou have set the old PYCAOSDBINI environment variable. Please use "
+                           "the new PYLINKAHEADINI variable instead and unset the old one.")
+    if os.path.exists(ini_user_caosdb):
+        raise RuntimeError("\n\nYou have a config file with the old naming scheme (pycaosdb.ini). "
                            f"Please use the new version and rename\n"
-                           f"    {ini_user}\nto\n    {expanduser('~/.pylinkahead.ini')}")
-    if os.path.exists(ini_cwd):
-        raise RuntimeError("You have a config file with the old naming scheme (pycaosdb.ini). "
+                           f"    {ini_user_caosdb}\nto\n    {ini_user}")
+    if os.path.exists(ini_cwd_caosdb):
+        raise RuntimeError("\n\nYou have a config file with the old naming scheme (pycaosdb.ini). "
                            f"Please use the new version and rename\n"
-                           f"    {ini_cwd}\nto\n    {join(getcwd(), 'pylinkahead.ini')}")
+                           f"    {ini_cwd_caosdb}\nto\n    {ini_cwd}")
+    # End: LinkAhead rename block ##################################################
 
     if "PYLINKAHEADINI" in environ:
         return_var.extend(configure(expanduser(environ["PYLINKAHEADINI"])))
-- 
GitLab