a5a78ef441
The existing db session strategy was inherited from a bunch of shell scripts that ran once in a single thread and exited. The surprising thing is that even worked at all. This change replaces that "strategy" with one where each thread clearly begins a new session as a context manager and passes that around to functions that need the DB. A thread-local session is used for convenience and extra safety. This also adds a fake provider that will produce fake images and servers quickly without needing a real nova or jenkins. This was used to develop the database change. Also some minor logging changes and very brief developer docs. Change-Id: I45e6564cb061f81d79c47a31e17f5d85cd1d9306
14 lines
295 B
Plaintext
14 lines
295 B
Plaintext
Developer setup:
|
|
|
|
mysql -u root
|
|
|
|
mysql> create database nodepool;
|
|
mysql> GRANT ALL ON nodepool.* TO 'nodepool'@'localhost';
|
|
mysql> flush privileges;
|
|
|
|
nodepool -d -c tools/fake.yaml
|
|
|
|
After each run (the fake nova provider is only in-memory):
|
|
|
|
mysql> delete from snapshot_image; delete from node;
|