Fix script argument parsing.

The vm_vdi_cleaner.py script's argument parsing was broken and unloved.

Change-Id: I1662534d65fd0e8472e092ed9f10d6cc059f1cab
clean up missing whitespace after ':'

Change-Id: I85a0348b978d4045ebb12a99f1bd9d5888a65b3b
Fix typo/bug in generic UC dropper

Change *fields -> *columns.

There should be tests for other backends mysql and postgres
but at this moment it is not so easy to implement it.

Fixes bug 1123848

Change-Id: I65a618760d499501589d5536c9f7dc64483b19ed
Imported Translations from Transifex

Change-Id: I1016d574022230b3fdfd6ae580a657aeb45bb1a0
Add generic dropper for duplicate rows

Add generic function that help us to drop duplicated rows from table,
before creating unique constarints. It is very usefull in migrations,
because it will allow DBA to make migrations without IntegrityError
exceptions.

It deletes all duplicates of rows except row with max value in id column.

blueprint db-unique-keys

Change-Id: I7e48d3eb78cf9a5d30752541b143b0c9fa1f838a
Remove race condition (in TaskLog)

Delete all duplicate rows with same (task_name, host, period_beginning,
period_ending) expect one with the biggest value in `id` column.

Create UC on fields (task_name, host, period_beginning, period_ending)

Replace Select then Insert -> Try to Insert.

blueprint db-unique-keys

Change-Id: I99f45a6de6630482e9c56738f894cc55a37fffaf
Merge "clean up missing whitespace after ':'"
Merge "Fix typo/bug in generic UC dropper"
Merge "Add generic dropper for duplicate rows"
Merge "Remove race condition (in TaskLog)"
Merge "Imported Translations from Transifex"
Merge "Fix script argument parsing."
Use DBAPI from oslo I have up for review.
Move context related methods

Move context related methods from sqlalchemy/api.py to nova/context.py
so they can be used outside of sqlalchemy.
MYSQLDB: Add framework for mysqldb impl

This re-works the db_backend importing to better support multiple
DB API implementations, where new implementations may use a class
to define their methods.  Also allows importing db implementations
by full path that are unknown to nova, so you don't have to
modify db/api.py for new implementations.

Implements bp db-mysqldb

MYSQLDB: Add insert() to mysqldb/connection

Adds generic insert() call to mysqldb connection that takes a table
name and a dictionary of column/values to insert.

Implements bp/db-mysqldb

MYSQLDB: Add update() to mysqldb/connection

Adds generic update() call to mysqldb connection that takes a table
name and a dictionary of column/values to update with a where clause.

Implements bp/db-mysqldb

MYSQLDB: Add bw_usage_update

Adds implementation for bw_usage_update

Implements bp/db-mysqldb

WiP instance_update() rewrite in mysqldb backend

Change-Id: I5ae349ee7dfed35588fff0a77666942f8bfc530e

Working *basic* instance_update

Still needs serious TLC and another coffee

Change-Id: I298e585d236d45dbc7fbd254612450b65ab7c002

Added several mysqldb functions:

* soft deletes
* instance_destroy

There is the start of a select() function, not sure if we should go that
route or kill it.

Lots of TODOs to fill in still.

Change-Id: I9e8f1bb7452417cc8e9482127826d8e496c3a36d

finished off instance_destroy

Add support for metadata updates to instance_update

Change-Id: I0d843a5135f3630d4c9376af8559ed90a59eddcb

Fix instance_get() to know columns without DictCursor

DictCursor doesn't work completely as it only prefixes the column
names with the table if the column is a duplicate (exists in another
table we're querying).

We have no way to know what columns go with with tables without querying
for tables when we connect.  Because we have to do this, we also no
longer need DictCursor and the turning into objects is a bit more
simple.

Also added a stupid instance_get_all() which now works.

less frameworky queries

Change-Id: I953cb962aa7d86aa9f180bd47a942f3e1db28923

Re-connects and schema

Re-connects moved out of connection.py and into api
Schema grabbed on init of API() and set.
Temporarily stuff into models and have transform grab it.

Dynamically create models

create a models.Models object which has attributes for every one of our
models.  On schema changes, models.Models will get swapped atomically.

models.Models.Instance would be our Instance model.

Schema format change

schema['tables'][tablename] was a list of columns.  Now it's a
dictionary containing table info.  Only key right now is 'columns' with
a list of columns.

Break instance_* functions out of API.

Route instance functions through a mixin class.

Change-Id: I2974af02c21efcae64068c3cd4f465a6435b0483

Transform via models

Adds .where() and .join() stuff to SQLQuery().  This greatly simplifies
api.py but should remain flexible enough, I think.

Results from SQLQuery are now models, but doing a obj.to_dict() on the
top level objects recurses and converts all objects to dictionaries.

Join security_groups with instance.

Requires joining a table just to get associations.. but yet no data
should be returned from that table.

sql-a joins security_groups.rules also... but I cannot find any use of
rules being accessed from security group objects that were joined with
instances.

It'd be nasty to implement, so I hope we don't need to!

fix bugs with columns_to_join in instance_get_all

Mixin loading turns FooBar into foo_bar for the module name.

Created bw_usage_cache MixIn and moved update() code.

Moved SQLQuery to sql.py

Added SelectQuery, UpdateQuery, InsertQuery(), etc.

Convert instance_update to use new Query stuff.

Adds instance_metadata and instance_system_metadata Mixins.
Also adds basic tests for mysqldb/sql.py

bug fixes

more bug fixes

removed unused methods from connection

pep8 fixes

Add docstrings to sql.py

Fixes for delete.

use model internally for instance update

add missing __init__.py for mysqldb tests.

Add InstanceInfoCache Mixin and API calls.

info_cache update bugfixes

Remove mysqldb specific tpool and clean up decorators

Also remove logging patch... don't monkey patch thread, instead.

instance_update: Unique hostname, instance type extra specs.

Retry on deadlocks.  Remove commit from bw_usage_cache update

Make models subclass dict and reference attributes accordingly

connection fixes
MYSQLDB: Add bandwidth update

Adds bw_usage_update()

Implements bp/db-mysqldb-impl
MYSQLDB: Add instance_get methods

Add instance_get_by_uuid() and instance_get_all()

Implements bp/db-mysqldb-impl
MySQLdb: Add instance destroy

Adds instance_destroy().

Implements bp/db-mysqldb-impl
MySQLdb: Adds info_cache get/update/delete.

Adds instance_info_cache_get, update(), and delete()

Implements bp/db-mysqldb-impl
MySQLdb: Adds instance_update calls.

Adds instance_update() and instance_update_and_get_original()

Implements bp/db-mysqldb-impl