From: Roland Häder Date: Sat, 3 Jun 2023 23:08:13 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=84b4e8ca4a486f8c071f2364d7d2f39eebce1fee;p=fba.git Continued: - ops, also they need 'fba.' now --- diff --git a/fba/instances.py b/fba/instances.py index 9fa8581..1271048 100644 --- a/fba/instances.py +++ b/fba/instances.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +from fba import fba import sys # Found info from node, such as nodeinfo URL, detection mode that needs to be @@ -53,7 +54,7 @@ def set_instance_data(key: str, domain: str, value: any): raise ValueError(f"Parameter 'domain' cannot be empty") elif not key in instance_data: raise ValueError(f"key='{key}' not found in instance_data") - elif not is_primitive(value): + elif not fba.is_primitive(value): raise ValueError(f"value[]='{type(value)}' is not a primitive type") # Set it @@ -108,14 +109,14 @@ def update_instance_data(domain: str): try: # DEBUG: print("DEBUG: Executing SQL:", sql_string) - cursor.execute(sql_string, fields) + fba.cursor.execute(sql_string, fields) - # DEBUG: print(f"DEBUG: Success! (rowcount={cursor.rowcount })") - if cursor.rowcount == 0: + # 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!") return - connection.commit() + fba.connection.commit() # DEBUG: print("DEBUG: Deleting instance_data for domain:", domain) for key in instance_data: