From 84b4e8ca4a486f8c071f2364d7d2f39eebce1fee Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 4 Jun 2023 01:08:13 +0200 Subject: [PATCH] Continued: - ops, also they need 'fba.' now --- fba/instances.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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: -- 2.39.5