def _update_computer(self, set_machine, insert_only=False): """Updates the computer info in the database. Creates a new computer entry if needed. """ # limpa valores desnecessários set_machine['dt_hr_ult_acesso'] = datetime.datetime.now() try: Computer.insert().execute(set_machine) except: pass if not insert_only: Computer.update(Computer.c.te_node_address==set_machine['te_node_address'], Computer.c.id_so==set_machine['id_so'] ).execute(set_machine) return True