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
Registry service is deprecated and due for removal since past
couple of cycles. This patch removes functional and unit tests of
registry.
NOTE:
Skipped 'test_create_with_live_time' test as it was dependent on
test_registry_client and test_registry_api modules. Something is
wrong with the test and will be corrected once entire registry code
is removed from the code base.
Change-Id: I560ab5260bed7e43d83b67a00057ac48f9e366e9
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>
With the original method _get_deployment_config_file() in config.py,
if the option config_file is specified in glance-api.conf, and run
command 'glance-api' under a directory, the the method load_paste_app()
will throw an IOError, but the IOError dose not been catched. The same
error will happen with'glance-registery'.
The reason for this IOError is the code "os.path.abspath(path)" in
_get_deployment_config_file() will return a value
'{cur_dir}/glance-api-paste.ini', but the 'glance-api-paste.ini' does
not exist under {cur_dir}.Such as running the command under /opt, but
the 'glance-api-paste.ini' dose not exist under /opt.
This pacth modifies one line of code in method _get_paste_config_path()
for solving the IOError. At the same time, it provides one test case.
Change-Id: I970c1acb073700b15e153dd08c9ec14d20f0e83d
Closes-Bug: 1712226
* Open file in text mode to write a paste configuration file, don't open
in binary mode
* Replace dict.keys()[0] with list(dict.keys())[0], dict.keys() now
returns an iterator on Python 3
* Replace xrange() with range()
* tox.ini: add the following glance.tests.unit.common tests to Python
3.4:
- test_config
- test_exception
- test_semver
Change-Id: Ibcfd106cad985b5e08f1e821b3b60a4d0d0911be
Provide healthcheck middleware from oslo_middleware to be able to
disable given nodes from loadbalancer. It's achieved by adding a new
pipeline which depending on existing of the
/etc/glance/healthcheck_disable file can return one of the following
results:
- 200 OK (if file does not exist)
- 503 DISABLED BY FILE (if file exist)
The healthcheck is available under /healthcheck URL, and the whole
mechanism behave similar to the Swift healthcheck system.
implements bp: healthcheck-middleware
Co-Authored-By: Erno Kuvaja <jokke@usr.fi>
Co-Authored-By: Kamil Rykowski <kamil.rykowski@intel.com>
DocImpact
Change-Id: I45f6a8c59ec3040aaf06f8bab46d8001c44dac7a
This could cause issues when upgrading to juno, since if config files are not
updated osprofiler can crash.
It is disabled by default in other services, such as cinder and heat.
Change-Id: Ide1be0d42e9e3640560564005b2ce1ffdf554e25
Closes-Bug: #1387320
Put osprofiler middleware as a almost first middleware.
This allows us to:
1) Get more preciese duration. We are measuring duration of all middlewares.
2) authenticate middleware is requesting keystone, so if we init osprofiler
before this middleware, we will get trace infomration from keystone as well.
Change-Id: I11c5d21e6e6b0bd514dee295da410b208d7c798c
Some of tests use different method of assertTrue(isinstance(A, B)) or
assertEqual(type(A), B). The correct way is to use assertIsInstance(A, B)
provided by testtools.
Change-Id: Ia8d38f73c159c7ef943a8f6cfe72b945cc493947
Closes-bug: #1268480