Below deprecation warning message is emitted continuously during each API call due to the introduction of glance_store library in patch [1]. DeprecationWarning: Property 'user' has moved to 'user_id' in version '2.6' and will be removed in version '3.0'" DeprecationWarning: Property 'tenant' has moved to 'project_id' in version '2.6' and will be removed in version '3.0'" There is an issue in glance_store library which is reported in LP bug [2] and it will be fixed by patch [3]. But we are not sure whether this issue will be fixed in Train cycle Moreover, in future we will need to deal and remove `tenant` and `user` attributes from context as these attributes are deprecated from oslo.context in version 2.6 and it's planned to be removed in 3.0. so this patch removes these 'tenant' and 'user' attributes from context. Also, added warnings fixture in the unit test to ensure these attributes are not used anywhere in the code. If used, it will result in test failure. [1] : https://review.opendev.org/#/c/675600 [2] : https://bugs.launchpad.net/glance-store/+bug/1844462 [3] : https://review.opendev.org/#/c/683034 Implements: blueprint tosca-csar-mgmt-driver Change-Id: I0cb320bbf237ebfac72b8e65128901c70cdd6780changes/01/683301/1
parent
d7ca6c5f9b
commit
554f7cd0a6
@ -0,0 +1,32 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
"""Fixtures for Tacker unit tests."""
|
||||
# NOTE(bhagyashris): This is needed for importing from fixtures.
|
||||
from __future__ import absolute_import
|
||||
|
||||
import warnings
|
||||
|
||||
import fixtures as pyfixtures
|
||||
|
||||
|
||||
class WarningsFixture(pyfixtures.Fixture):
|
||||
"""Filters out warnings during test runs."""
|
||||
|
||||
def setUp(self):
|
||||
super(WarningsFixture, self).setUp()
|
||||
# NOTE(bhagyashris): user/tenant is deprecated in oslo.context
|
||||
# so don't let anything new use it
|
||||
warnings.filterwarnings(
|
||||
'error', message="Property '.*' has moved to '.*'")
|
||||
|
||||
self.addCleanup(warnings.resetwarnings)
|
Loading…
Reference in new issue