- trim off last dot in host/domain name
- only release lock when acquired, e.g. check_instance.py doesn't need a 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.")
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)
# 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 ...")