6bb6c0bbdd
- This change tries to address an edge case discovered when running placement under mod_wsgi where if the placement wsgi application is re-initialize the db_api configure method attempts to reconfigure a started transaction factory. - This since oslo.db transaction factories do not support reconfiguration at runtime this result in an exception being raised preventing reloading of the Placement API without restarting apache to force mod_wsgi to recreate the python interpreter. - This change introduces a run once decorator to allow annotating functions that should only be executed once for the lifetime of an interpreter. - This change applies the run_once decorator to the db_api configure method, to suppress the attempt to reconfigure the current TransactionFactory on application reload. Co-Authored-By: Balazs Gibizer <balazs.gibizer@ericsson.com> Closes-Bug: #1799246 Related-Bug: #1784155 Change-Id: I704196711d30c1124e713ac31111a8ea6fa2f1ba