]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Only warn about deprecation warnings once
authorJoshua Harlow <harlowja@yahoo-inc.com>
Fri, 27 Jun 2014 00:52:04 +0000 (17:52 -0700)
committerJoshua Harlow <harlowja@yahoo-inc.com>
Fri, 27 Jun 2014 00:52:59 +0000 (17:52 -0700)
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

bin/cinder-all
bin/cinder-api
bin/cinder-backup
bin/cinder-clear-rabbit-queues
bin/cinder-manage
bin/cinder-rpc-zmq-receiver
bin/cinder-scheduler
bin/cinder-volume
bin/cinder-volume-usage-audit

index a3b2fcf7f70d8f82c7036244e7e1257d4f0bb3b5..1e5842d88cd443e5d67963af599d45ad40c8b25c 100755 (executable)
@@ -32,6 +32,9 @@ eventlet.monkey_patch()
 
 import os
 import sys
+import warnings
+
+warnings.simplefilter('once', DeprecationWarning)
 
 from oslo.config import cfg
 
index 8990f641e70309dbfc403f93debf13b56739976e..e5b411dee73a1b71c6b8e77f23d50041304e3556 100755 (executable)
@@ -22,6 +22,9 @@ eventlet.monkey_patch()
 
 import os
 import sys
+import warnings
+
+warnings.simplefilter('once', DeprecationWarning)
 
 from oslo.config import cfg
 
index 2b5a634cca2cfd4e8b16632120dcf78ff7638af2..69f2c76bf05720e8b6ee0e4292f99d03d3c4a78f 100755 (executable)
@@ -20,6 +20,9 @@
 
 import os
 import sys
+import warnings
+
+warnings.simplefilter('once', DeprecationWarning)
 
 import eventlet
 
index 4a59b8b3d5edb904e3e36d6462e925718fd3075e..bab50ec52ca1a8e3454ee11046deed284fdc770e 100755 (executable)
@@ -23,6 +23,9 @@
 
 import os
 import sys
+import warnings
+
+warnings.simplefilter('once', DeprecationWarning)
 
 from oslo.config import cfg
 
index c9eec4ad99fbb6c626cd8bb25175098778a79a53..a0c2df0752df7d95d9ed38ae9cb76142b4e30cd5 100755 (executable)
@@ -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
index 07db167b0bd773dabf1811ae64dfb80606f1d84c..cd7d94a8f8080ccd0602283f7fbb60ca9d14a623 100755 (executable)
@@ -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...
index e8ee1175bafa01038561a04282a04c9bdc7cb63d..a01fe3e4e9ba175287433ec5ee95dbb910675f28 100755 (executable)
@@ -24,6 +24,9 @@ eventlet.monkey_patch()
 
 import os
 import sys
+import warnings
+
+warnings.simplefilter('once', DeprecationWarning)
 
 from oslo.config import cfg
 
index 5b8b8a8d9c2fa82af5dc82d44424df6fcf3eb492..45c4ed4613e9eefdaf63f23866558ad0f38d4970 100755 (executable)
@@ -28,6 +28,9 @@ else:
     eventlet.monkey_patch()
 
 import sys
+import warnings
+
+warnings.simplefilter('once', DeprecationWarning)
 
 from oslo.config import cfg
 
index accca839d8dac747d0642162d39cf441d06789f2..3f223d38a7bb27980cdc8641cb29b8451ae3a5bb 100755 (executable)
@@ -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