glance/glance/cmd
Boris Pavlovic 048a40c0b5 Use common Oslo database session
Use common oslo database code for work with session, connection, engines
instead of glance implementations.
Work with config options modified due to new common code config.
Removed unused glance code and tests for it.

Details:

glance/cmd/manage.py
- removed load load the glance-registry config. We load sql connection
  in common code now.

glance/db/sqlalchemy/api.py
- removed functions _wrap_db_error(), _is_db_connection_error(),
  _get_maker(), get_engine(), _ping_listener() and config
  `sql_connection_opt`. We have all these thigs in module
  `glance.openstack.common.db.sqlalchemy`.
- modified functions setup_db_env(), add_cli_options(), clear_db_env().
- functions _get_session() and get_engine() now call same functions
  from module `glance.openstack.common.db.sqlalchemy`.
- replaced sqlalchemy exception `sqlalchemy.exc.IntegrityError` to
  database duplicate exception - `db_exc.DBDuplicateEntry`.

Removed redundant tests - we use common code , so a lot of features was
already tested in Oslo.

Global variable _ENGINE was replaced by common function get_engine().

DocImpact
New database config options came from Oslo. See Table below
-------------------------------------------------------------------
Database config options ([group] option)
-----------------------------|-------------------------------------
       Glance                | Oslo
-----------------------------|-------------------------------------
[DEFAULT] sql_connection     |  [database] connection
[DEFAULT] sql_idle_timeout   |  [database] idle_timeout
[DEFAULT] sql_max_retries    |  [database] max_retries
[DEFAULT] sql_retry_interval |  [database] retry_interval
[DEFAULT] db_auto_create     |  NONE
[DEFAULT] sqlalchemy_debug   |  [database] connection_debug
[DEFAULT] use_tpool          |  [database] use_tpool
NONE                         |  [database] slave_connection
NONE                         |  [database] min_pool_size
NONE                         |  [database] max_pool_size
NONE                         |  [database] slave_connection
NONE                         |  [database] min_pool_size
NONE                         |  [database] max_pool_size
NONE                         |  [database] max_overflow
NONE                         |  [database] connection_trace
NONE                         |  [database] pool_timeout
-------------------------------------------------------------------

blueprint db-use-oslo-common-code

Change-Id: I3ff976545b1a82ff8df780e34128fcaf6f892b8c
2014-01-03 05:37:41 +04:00
..
__init__.py Changed header from LLC to Foundation based on trademark policies 2013-09-10 18:29:53 +02:00
api.py Fix and enable gating on H306 2014-01-01 16:44:19 +01:00
cache_cleaner.py Changed header from LLC to Foundation based on trademark policies 2013-09-10 18:29:53 +02:00
cache_manage.py Make code base E125 and E126 compliant 2013-12-30 13:03:24 +00:00
cache_prefetcher.py Changed header from LLC to Foundation based on trademark policies 2013-09-10 18:29:53 +02:00
cache_pruner.py Changed header from LLC to Foundation based on trademark policies 2013-09-10 18:29:53 +02:00
control.py Make code base E125 and E126 compliant 2013-12-30 13:03:24 +00:00
manage.py Use common Oslo database session 2014-01-03 05:37:41 +04:00
registry.py Use common Oslo database session 2014-01-03 05:37:41 +04:00
replicator.py Make Glance code base H201 compliant 2013-12-23 00:38:52 +00:00
scrubber.py Changed header from LLC to Foundation based on trademark policies 2013-09-10 18:29:53 +02:00