Merge "Fix wrong stacklevel in deprecation warnings"

This commit is contained in:
Zuul 2024-02-27 12:35:11 +00:00 committed by Gerrit Code Review
commit a8700687de
5 changed files with 6 additions and 6 deletions

View File

@ -84,7 +84,7 @@ class HyperVInspector(virt_inspector.Inspector):
self._host_max_cpu_clock = self._compute_host_max_cpu_clock()
warnings.warn('Support for HyperV is deprecated.',
category=DeprecationWarning, stacklevel=3)
category=DeprecationWarning, stacklevel=2)
def _compute_host_max_cpu_clock(self):
hostutils = utilsfactory.get_hostutils()

View File

@ -120,7 +120,7 @@ class VsphereInspector(virt_inspector.Inspector):
get_api_session(self.conf), 1000)
warnings.warn('Support for VMWare vSphere is deprecated.',
category=DeprecationWarning, stacklevel=3)
category=DeprecationWarning, stacklevel=2)
def _get_vm_mobj_not_power_off_or_raise(self, instance):
vm_mobj = self._ops.get_vm_mobj(instance.id)

View File

@ -39,7 +39,7 @@ class FirewallPollster(base.BaseServicesPollster):
warnings.warn('Support for Neutron FWaaS has been deprecated '
'and will be removed in a future release.',
category=DeprecationWarning, stacklevel=3)
category=DeprecationWarning, stacklevel=2)
@property
def default_discovery(self):
@ -86,7 +86,7 @@ class FirewallPolicyPollster(base.BaseServicesPollster):
warnings.warn('Support for Neutron FWaaS has been deprecated '
'and will be removed in a future release.',
category=DeprecationWarning, stacklevel=3)
category=DeprecationWarning, stacklevel=2)
@property
def default_discovery(self):

View File

@ -60,7 +60,7 @@ class OpencontrailDriver(driver.Driver):
"""
def __init__(self, conf):
warnings.warn('Support for OpenContrail is deprecated.',
category=DeprecationWarning, stacklevel=3)
category=DeprecationWarning, stacklevel=2)
super(OpencontrailDriver, self).__init__(conf)
def _prepare_cache(self, endpoint, params, cache):

View File

@ -81,7 +81,7 @@ class OpenDayLightDriver(driver.Driver):
"""
def __init__(self, conf):
warnings.warn('Support for OpenDaylight is deprecated.',
category=DeprecationWarning, stacklevel=3)
category=DeprecationWarning, stacklevel=2)
super(OpenDayLightDriver, self).__init__(conf)
def _prepare_cache(self, endpoint, params, cache):