update deprecated stanza

the deprecated stanza from nova had hard coded
"Deprecated Config", but is now be used in not config
scenarios. Update it to just "Deprecated".

Change-Id: Icf86447aea6cd509e4e67fe0be7e9157006410a4
This commit is contained in:
Sean Dague 2012-11-15 18:38:36 -05:00
parent 11101e6212
commit 90ada0eb54
2 changed files with 4 additions and 4 deletions

View File

@ -174,7 +174,7 @@ class ContextAdapter(logging.LoggerAdapter):
self.log(logging.AUDIT, msg, *args, **kwargs)
def deprecated(self, msg, *args, **kwargs):
stdmsg = _("Deprecated Config: %s") % msg
stdmsg = _("Deprecated: %s") % msg
if CONF.fatal_deprecations:
self.critical(stdmsg, *args, **kwargs)
raise DeprecatedConfig(msg=stdmsg)

View File

@ -38,16 +38,16 @@ class DeprecatedConfigTestCase(test_utils.BaseTestCase):
def test_deprecated(self):
LOG.deprecated('test')
self.assertEqual(self.warnbuffer, 'Deprecated Config: test')
self.assertEqual(self.warnbuffer, 'Deprecated: test')
def test_deprecated_fatal(self):
self.config(fatal_deprecations=True)
self.assertRaises(logging.DeprecatedConfig,
LOG.deprecated, "test2")
self.assertEqual(self.critbuffer, 'Deprecated Config: test2')
self.assertEqual(self.critbuffer, 'Deprecated: test2')
def test_deprecated_logs_only_once(self):
LOG.deprecated('only once!')
LOG.deprecated('only once!')
LOG.deprecated('only once!')
self.assertEqual(self.warnbuffer, 'Deprecated Config: only once!')
self.assertEqual(self.warnbuffer, 'Deprecated: only once!')