From 7e75f041765dc2d803f86b689f2a618237508b13 Mon Sep 17 00:00:00 2001 From: pducolin Date: Tue, 16 Nov 2021 11:45:56 +0100 Subject: [PATCH] [snmp] support profiles with no metrics --- .../dev/tooling/commands/meta/snmp/translate_profile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/snmp/translate_profile.py b/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/snmp/translate_profile.py index 67f11e2f0f2ed..8c8aeacc93ccc 100644 --- a/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/snmp/translate_profile.py +++ b/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/snmp/translate_profile.py @@ -64,7 +64,8 @@ def translate_profile(ctx, profile_path, mib_source_url): data = yaml.safe_load(f.read()) output = [] - for metric in data['metrics']: + metrics = data.get('metrics', []) + for metric in metrics: mib = metric['MIB'] try: mib_view_controller.mibBuilder.loadModule(mib)