]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 4 Jun 2023 11:32:55 +0000 (13:32 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 4 Jun 2023 11:57:25 +0000 (13:57 +0200)
- trim off last dot in host/domain name
- only release lock when acquired, e.g. check_instance.py doesn't need a lock

fba/boot.py
fba/fba.py
fba/instances.py

index 605d2ea8522c5ac432f96de7bc997f97c43722fa..dfe7ae4edeb612d1cb578255b30ac8cc6483dd21 100644 (file)
@@ -38,8 +38,9 @@ def acquire_lock():
 def shutdown():
     print("DEBUG: Closing database connection ...")
     fba.connection.close()
-    print("DEBUG: Releasing lock ...")
-    LOCK.close()
-    print(f"DEBUG: Deleting lockfile='{lockfile}' ...")
-    os.remove(lockfile)
+    if LOCK != None:
+        print("DEBUG: Releasing lock ...")
+        LOCK.close()
+        print(f"DEBUG: Deleting lockfile='{lockfile}' ...")
+        os.remove(lockfile)
     print("DEBUG: Shutdown completed.")
index 2025397906b15b39428a2e849740185edeb1485f..4d2d21dddc56cd07bb3c07ce661c7263cedd81a5 100644 (file)
@@ -1425,8 +1425,8 @@ def tidyup_domain(domain: str) -> str:
     if type(domain) != str:
         raise ValueError(f"Parameter domain[]={type(domain)} is not expected")
 
-    # All lower-case and strip spaces out
-    domain = domain.lower().strip()
+    # All lower-case and strip spaces out + last dot
+    domain = domain.lower().strip().rstrip(".")
 
     # No port number
     domain = re.sub("\:\d+$", "", domain)
index 3312fa824a3bc359f59e6b6eb87dc801636a6136..8be7a380f1026efcc14abee5711c42780abd69d5 100644 (file)
@@ -116,7 +116,7 @@ def update_instance_data(domain: str):
 
         # DEBUG: print(f"DEBUG: Success! (rowcount={fba.cursor.rowcount })")
         if fba.cursor.rowcount == 0:
-            print(f"WARNING: Did not update any rows: domain='{domain}',fields()={len(fields)} - EXIT!")
+            # DEBUG: print(f"DEBUG: Did not update any rows: domain='{domain}',fields()={len(fields)} - EXIT!")
             return
 
         # DEBUG: print("DEBUG: Committing changes ...")