parameters: (self)
docstring: Clean old stored machines and related tables.
docstring_summary: Clean old stored machines and related tables.
docstring_tokens: Clean old stored machines and related tables .
function: def clean_machines(self):
          """Clean old stored machines and related tables."""
          # Secondary table.
          # TODO: this is better done via cascade delete.
          self.engine.execute(machines_tags.delete())
  
          session = self.Session()
          try:
              session.query(Machine).delete()
              session.commit()
          except SQLAlchemyError as e:
              log.exception("Database error cleaning machines: {0}".format(e))
              session.rollback()
          finally:
              session.close()
function_tokens: def clean_machines ( self ) : # Secondary table. # TODO: this is better done via cascade delete. self . engine . execute ( machines_tags . delete ( ) ) session = self . Session ( ) try : session . query ( Machine ) . delete ( ) session . commit ( ) except SQLAlchemyError as e : log . exception ( "Database error cleaning machines: {0}" . format ( e ) ) session . rollback ( ) finally : session . close ( )