Deprecate CONF.monkey_patch

This option, along with monkey_patch_modules, is
arguably worse than hooks since it doesn't even
rely on having in-tree code. It's super legacy,
not tested, not supported and is a barrier to
interoperability, so we should deprecate it for
removal.

This also allows us to deprecate the default_publisher_id
option which is used for the legacy notify_decorator
which is only used if specified with the monkey_patch_modules
option, which is also deprecated here.

Also removed the nova.api.ec2.cloud mention from the
config option help text for monkey_patch_modules
since that isn't valid in nova anymore.

Change-Id: Id793ac2c5cdc5dc473f95eac53b77617a1e389da
This commit is contained in:
Matt Riedemann
2017-08-25 18:21:57 -04:00
parent 1080506f16
commit a3bc1b067b
5 changed files with 42 additions and 2 deletions

View File

@@ -498,8 +498,9 @@ def format_remote_path(host, path):
return "%s:%s" % (safe_ip_format(host), path)
# TODO(mriedem): Remove this in Rocky.
def monkey_patch():
"""If the CONF.monkey_patch set as True,
"""DEPRECATED: If the CONF.monkey_patch set as True,
this function patches a decorator
for all functions in specified modules.
You can set decorators for each modules
@@ -517,6 +518,7 @@ def monkey_patch():
# If CONF.monkey_patch is not True, this function do nothing.
if not CONF.monkey_patch:
return
LOG.warning('Monkey patching nova is deprecated for removal.')
if six.PY2:
is_method = inspect.ismethod
else: