From 769515af43e0affc2a58c93f6fe77ab0c11ec149 Mon Sep 17 00:00:00 2001 From: Ian Bucad Date: Mon, 23 Aug 2021 14:33:48 +1000 Subject: [PATCH 1/3] Update mib_source_url https://github.com/projx/snmp-mibs has been disabled --- .../dev/tooling/commands/meta/snmp/translate_profile.py | 2 +- 1 file changed, 1 insertion(+), 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 5eb115d0aece3..3c928ea9db37e 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 @@ -37,7 +37,7 @@ def fetch_mib(mib, source_url): @click.argument('profile_path') @click.option( '--mib_source_url', - default='https://raw.githubusercontent.com/projx/snmp-mibs/master/@mib@', + default='https://raw.githubusercontent.com:443/DataDog/mibs.snmplabs.com/master/asn1/@mib@', help='Source url to fetch missing MIBS', ) @click.pass_context From 8721a7f23ab19ef28e3529aa8272840e61c41c5f Mon Sep 17 00:00:00 2001 From: Ian Bucad Date: Wed, 25 Aug 2021 12:11:21 +1000 Subject: [PATCH 2/3] code review --- .../dev/tooling/commands/meta/snmp/generate_profile.py | 3 ++- .../dev/tooling/commands/meta/snmp/translate_profile.py | 3 ++- datadog_checks_dev/datadog_checks/dev/tooling/constants.py | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/snmp/generate_profile.py b/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/snmp/generate_profile.py index ef83e22ca1487..2fcbf7a983d0d 100644 --- a/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/snmp/generate_profile.py +++ b/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/snmp/generate_profile.py @@ -10,6 +10,7 @@ import yaml from ...console import CONTEXT_SETTINGS, abort, echo_debug, echo_info, set_debug +from ....constants import MIB_SOURCE_URL @click.command(context_settings=CONTEXT_SETTINGS, short_help='Generate an SNMP profile from a collection of MIB files') @@ -22,7 +23,7 @@ '--source', '-s', help='Source of the MIBs files. Can be a url or a path for a directory', - default='http://raw.githubusercontent.com/trevoro/snmp-mibs/master/mibs/@mib@', + default=MIB_SOURCE_URL, ) @click.pass_context def generate_profile_from_mibs(ctx, mib_files, filters, aliases, debug, interactive, source): 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 3c928ea9db37e..553832969245b 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 @@ -6,6 +6,7 @@ import click import yaml +from ....constants import MIB_SOURCE_URL from ...console import CONTEXT_SETTINGS @@ -37,7 +38,7 @@ def fetch_mib(mib, source_url): @click.argument('profile_path') @click.option( '--mib_source_url', - default='https://raw.githubusercontent.com:443/DataDog/mibs.snmplabs.com/master/asn1/@mib@', + default=MIB_SOURCE_URL, help='Source url to fetch missing MIBS', ) @click.pass_context diff --git a/datadog_checks_dev/datadog_checks/dev/tooling/constants.py b/datadog_checks_dev/datadog_checks/dev/tooling/constants.py index ff8ca5fe7499d..eab697d5535ff 100644 --- a/datadog_checks_dev/datadog_checks/dev/tooling/constants.py +++ b/datadog_checks_dev/datadog_checks/dev/tooling/constants.py @@ -92,6 +92,8 @@ ROOT = '' +MIB_SOURCE_URL = 'https://raw.githubusercontent.com:443/DataDog/mibs.snmplabs.com/master/asn1/@mib@' + def get_root(): return ROOT From b8fe7d420af80917b55323d337704c0c5d26d1e0 Mon Sep 17 00:00:00 2001 From: Alexandre Yang Date: Thu, 9 Sep 2021 08:32:11 +0200 Subject: [PATCH 3/3] Fix imports order --- .../dev/tooling/commands/meta/snmp/generate_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/snmp/generate_profile.py b/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/snmp/generate_profile.py index 2fcbf7a983d0d..b91caa205e0d8 100644 --- a/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/snmp/generate_profile.py +++ b/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/snmp/generate_profile.py @@ -9,8 +9,8 @@ import click import yaml -from ...console import CONTEXT_SETTINGS, abort, echo_debug, echo_info, set_debug from ....constants import MIB_SOURCE_URL +from ...console import CONTEXT_SETTINGS, abort, echo_debug, echo_info, set_debug @click.command(context_settings=CONTEXT_SETTINGS, short_help='Generate an SNMP profile from a collection of MIB files')