Only warn about deprecation warnings once
Instead of repeatly emitting data about which modules are deprecated again and again just warn about those deprecation once and then never warn about them again. This is a good thing to have, and will be needed as taskflow moves one of its classes used in cinder to a new and longer-term location and will emit deprecation about the usage of the old location. Change-Id: I962f9bab920a03eca235c9e4591d367687e44954
This commit is contained in:
parent
e20ef8a8bb
commit
f946c7e733
@ -32,6 +32,9 @@ eventlet.monkey_patch()
|
||||
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
warnings.simplefilter('once', DeprecationWarning)
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
|
@ -22,6 +22,9 @@ eventlet.monkey_patch()
|
||||
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
warnings.simplefilter('once', DeprecationWarning)
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
|
@ -20,6 +20,9 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
warnings.simplefilter('once', DeprecationWarning)
|
||||
|
||||
import eventlet
|
||||
|
||||
|
@ -23,6 +23,9 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
warnings.simplefilter('once', DeprecationWarning)
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
|
@ -57,6 +57,9 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
warnings.simplefilter('once', DeprecationWarning)
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
|
@ -19,6 +19,9 @@ eventlet.monkey_patch()
|
||||
import contextlib
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
warnings.simplefilter('once', DeprecationWarning)
|
||||
|
||||
# If ../cinder/__init__.py exists, add ../ to Python search path, so that
|
||||
# it will override what happens to be installed in /usr/(local/)lib/python...
|
||||
|
@ -24,6 +24,9 @@ eventlet.monkey_patch()
|
||||
|
||||
import os
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
warnings.simplefilter('once', DeprecationWarning)
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
|
@ -28,6 +28,9 @@ else:
|
||||
eventlet.monkey_patch()
|
||||
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
warnings.simplefilter('once', DeprecationWarning)
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
|
@ -38,6 +38,9 @@ from datetime import datetime
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
import warnings
|
||||
|
||||
warnings.simplefilter('once', DeprecationWarning)
|
||||
|
||||
from oslo.config import cfg
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user