Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix config option rename refactor #7690

Merged
merged 2 commits into from
Sep 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions disk/datadog_checks/disk/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,20 @@ def __init__(self, name, init_config, instances):
self._compile_tag_re()
self._blkid_label_re = re.compile('LABEL=\"(.*?)\"', re.I)

deprecations = {
deprecations_init_conf = {
'file_system_global_blacklist': 'file_system_global_exclude',
'device_global_blacklist': 'device_global_exclude',
'mount_point_global_blacklist': 'mount_point_global_exclude',
}
for old_name, new_name in deprecations_init_conf.items():
if init_config.get(old_name):
self.warning(
'`%s` is deprecated and will be removed in a future release. Please use `%s` instead.',
old_name,
new_name,
)

deprecations_instance = {
'file_system_whitelist': 'file_system_include',
'file_system_blacklist': 'file_system_exclude',
'device_whitelist': 'device_include',
Expand All @@ -80,8 +90,8 @@ def __init__(self, name, init_config, instances):
'excluded_disk_re': 'device_exclude',
'excluded_mountpoint_re': 'mount_point_exclude',
}
for old_name, new_name in deprecations.items():
if instance.get('old_name'):
for old_name, new_name in deprecations_instance.items():
if instance.get(old_name):
self.warning(
'`%s` is deprecated and will be removed in a future release. Please use `%s` instead.',
old_name,
Expand Down