hub-cap/sneaky-pete — pull request #35 by TimSimpsonR (2011-12-02 13:57:35+00:00)
Title: Added more rules to how MySqlNovaUpdater worked.

* Before, the prepare and the periodic_tasks functions would simply call this class and change the state in the Nova database. This turned out to not be a good idea because there was a race condition, where the periodic_task method might check the status of the MySQL instance before it was installed and report the state of it as in error. We'd mitigated this race condition with a work-around but the root cause was still bad.
* Now MySqlNovaUpdater checks the Nova DB, and if the status does not exist or is BUILDING or FAILED, it assumes MySql isn't present and does not check its status or update the Nova DB.
* Changed the interface of the MySqlNovaUpdater class so the rules for how this works will stay there and not in the client classes which use it.
* Added a mutex to MySqlNovaUpdater since the same instance will now be called from more than one thread.
* Added a unit test for MySqlNovaUpdater.