Using the healthcheck middleware as a filter is deprecated and
the middleware should be used as an application[1].
[1] 6feaa13610c450c8486f969703768db5319b4846
This change updates definition and usage of the healthcheck middleware
accordingly to avoid the following deprecation warning.
DeprecationWarning: Using function/method 'Healthcheck.factory()' is
deprecated: The healthcheck middleware must now be configured as
an application, not as a filter.
Closes-Bug: #1937901
Change-Id: Id41e0313a481bea4e2bb14c69f2ad8a2070aa9be
This patch removes majority of the registry and it's related
endpoints and config options that has been deprecated for
removal in various releases.
Change-Id: I75014bd50bf382efebe56bd89c20ffefbdde25f5
In order to run the unit and functional Glance tests on Windows, we
have to:
* avoid monkey patching the os module on Windows (which causes Popen
to fail)
* update sqlite connection URL
* avoid os.fork, not available on Windows.
* we'll use subprocess.Popen when spinning up http servers.
* for the really simple ones defined in the test helpers, we'll just
use threads
* do not attempt to connect to '0.0.0.0', use '127.0.0.1' instead
* some tests aren't properly skipped (xattr ones), so we're covering that
as well
* skip log rotation test, we can't move in-use files. Log rotation can
be performed by the log handler itself.
* expect an exception when hitting connection timeouts
* avoid installing unavailable test requirements (xattr, pysendfile)
* pin the instance creation timestamp. some tests that deal with
markers rely on ordering, which can be flipped if the timestamps are
identical (can happen in case of resources created one after the
other, not sure yet if this happens really fast or the clock isn't
accurate enough).
* add a few seconds to some timeouts (much needed when running the tests
in VMs).
blueprint windows-support
Change-Id: Ife69f56a3f9f4d81e1e2e47fde4778efd490938f
We would like to fully remove mox from the test tree. Even for tests
that don't use mox's validation, many of them are using the symbol
patching with self.stubs.Set. We can do the same thing with the
monkeypatch fixture instead.
This introduces self.stub_out to nova/test.py and an example of what a
stubs => stub_out change would look like.
The teardown function in the converted test was removed at the same
time, as those should no longer be used.
Part of the mox community goal for Rocky.
Change-Id: I8f471ff8fee600ebb4e8907bf240007b7b4fe59f
Signed-off-by: Chuck Short <chucks@redhat.com>
Fixed the tests in the `glance.tests.integration` module. Enabled
them to run for py35 job in tox.ini. All changes are related to
string/bytes object differences in python 2.7 vs 3.5.
Also added testing of tasks location header value due to a change in
how it is handled in py27 vs py35.
Change-Id: I26aae0c518fe84c9967461a3b9fef02bc0c17923
* Functional tests now use alembic instead of sqlalchmey-migrate
to build and destroy test database.
* All tests now use a file-based sqlite db as opposed to an in-memory
database.
Partially-Implements: blueprint alembic-migrations
Change-Id: I77921366a05ba6f9841143af89c1f4059d8454c6
Depends-On: Ie8594ff339a13bf190aefa308f54e97ee20ecfa2
Config option sqlite_db is deprecated in
0a1bae9859079fb21a03716be947c5f1da6db0a2, and deprecate
argument sqlite_db in method set_defaults in
18d26125d02c8a017d8541339737981bf242616b, Glance doesn't
use config option sqlite_db's value, but config option
connection instead. For more details about sqlite connection
string, please see:
http://docs.sqlalchemy.org/en/rel_1_0/core/engines.html#sqlite
Change-Id: I6eadd9d0c3c53d1c8a1afb441d5bdf647f4925e0
EXPERIMENTAL Glance v3 API has been removed in favor of standalone API
(EXPERIMENTAL Artifacts API of v0.1).
This patch introduces a new process entry point to run on a different
port (9494 by default), with its own configuration file and a paste
config.
A controller stub for old /v3 api remains in the glnace.api package for
the compatibility with existing paste configuration which may reference
it. This stub returns a 301 redirects to glare endpoint if it is present
or 410 errors otherwise.
To reuse the existing version_negotiation middleware some refactoring
has been made.
Implements blueprint: move-v3-to-glare
Change-Id: I5b7bd4cdcc5f2a40fc4a5f74bcc422fd700c4fb0
Since v3 is still unstable and has experimental status it's
better to disable it by default for security reasons. This
commit does it by setting 'enable_v3_api=False'.
Also all required documentation was added to related sections.
DocImpact
Change-Id: I412d0645d667400333532123008a24966aa23880
oslo_db was moved out of the oslo namespace in
oslo.db>=1.4.0.
Change-Id: I13620d26ff12c55b2294b3b051669e0e98513a10
Related-to: blueprint drop-namespace-packages
oslo_config was moved out of the oslo namespace in oslo.config>=1.6.0.
Related-to: blueprint drop-namespace-packages
Change-Id: I30ecbf8f9de77496fcb643c7ad9738d79ad359f0
register_opts already registers options for stores as well. Just call
that function instead of calling register_store_opts too.
Change-Id: I7726c098fec1160549251b3dd30ae02bd89bcadc
This commits removes the old `store` package from glance and adopts the
usage of the new glance.store library. The library was designed to
preserve backwards compatibility as much as possible. In fact, most of
the changes in this patch are related to function args ordering and not
function renames or workflow changes.
Some changes that are worth mentioning:
1. Glance store doesn't rely on a global config object. All config
options must be explicitly registered.
2. All store operations now accepted an optional context. This is a
fallout from the context not being required in the `Store` constructor
anymore.
3. Store drivers are behind a private package called `_drivers` and
they're not suppose to be accessed directly. Instead, functions like
`get_store_from_scheme` should be used.
4. Stores are disabled by default
5. All the store specific options are under the `glance_store` group.
DocImpact:
The old store related configuration options have been moved under the
`glance_store` section. However, the old options will go through a
deprecation path. That is, they'll still be read from the `DEFAULT`
section to give deployers enough time to update their config files.
In k-2, the deprecated options will be completely obsolete.
Closes-bug: #1291848
Implements-blueprint: create-store-package
Change-Id: Iaacc70993ad5da292b93de42bbecda73d53b19fd
Replace common oslo code glance.openstack.common.db
by usage of oslo.db library and remove common code.
Change-Id: I27216e03763f72e8665121d4440ba2828349eac5
Changes due to use common migration module instead of Glance
implementation.
Removed glance.db.sqlalchemy.migration module and related code.
blueprint db-use-oslo-common-code
Change-Id: Ib7e2e478a84a90cc9c773f2733dc60b88834fd23
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
This commit makes the glance code base E125 and E126 compliant :
* E125 continuation line does not distinguish itself from next logical line
* E126 continuation line over-indented for hanging indent
Change-Id: I7120149bedb665fb66320498fe98948602a6cd52
Closes-bug: #1263437
- add REST API layer for async worker(tasks) to
support tasks operations.
- update to include sparse task for tasks.index
- add domain proxies for handling authorization,
policy enforce, notification while processing
task requests.
- add Task domain entity and TaskFactory to create
new Task domain entity objects.
- add integration test for testing tasks api
Co-authored-by: Fei Long Wang <flwang@cn.ibm.com>
Partially implement blueprint async-glance-workers
Change-Id: I072cbf351c06f59a7702733b652bfa63e5abbaa6