# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+from fba import fba
import sys
# Found info from node, such as nodeinfo URL, detection mode that needs to be
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
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: