From 020dc42c46903fbbc9576a2a1f08a338583cd8e6 Mon Sep 17 00:00:00 2001 From: Xiangce Liu Date: Thu, 3 Nov 2022 14:14:23 +0800 Subject: [PATCH] chore: remove the unused 'ethernet_interfaces' spec (#3577) Signed-off-by: Xiangce Liu Signed-off-by: Xiangce Liu --- insights/specs/__init__.py | 1 - insights/specs/datasources/ethernet.py | 4 ++-- insights/specs/default.py | 1 - insights/tests/datasources/test_ethernet.py | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/insights/specs/__init__.py b/insights/specs/__init__.py index 1ff396827d..7b51956725 100644 --- a/insights/specs/__init__.py +++ b/insights/specs/__init__.py @@ -157,7 +157,6 @@ class Specs(SpecSet): etc_udev_40_redhat_rules = RegistryPoint(filterable=True) etc_udev_oracle_asm_rules = RegistryPoint(multi_output=True, filterable=True) etcd_conf = RegistryPoint(filterable=True) - ethernet_interfaces = RegistryPoint() ethtool = RegistryPoint(multi_output=True) ethtool_S = RegistryPoint(multi_output=True) ethtool_T = RegistryPoint(multi_output=True) diff --git a/insights/specs/datasources/ethernet.py b/insights/specs/datasources/ethernet.py index 351b1905af..83380bb59e 100644 --- a/insights/specs/datasources/ethernet.py +++ b/insights/specs/datasources/ethernet.py @@ -10,7 +10,7 @@ class LocalSpecs(Specs): - """ Local specs used only by ethernet_interfaces datasource. """ + """ Local specs used only by ethernet.interfaces datasource. """ ip_link = simple_command("/sbin/ip -o link") @@ -30,7 +30,7 @@ def interfaces(broker): Note: This datasource may be executed using the following command: - ``insights cat --no-header ethernet_interfaces`` + ``insights cat --no-header ethernet.interfaces`` Sample data returned:: diff --git a/insights/specs/default.py b/insights/specs/default.py index 22b23806f8..f449cc8b2d 100644 --- a/insights/specs/default.py +++ b/insights/specs/default.py @@ -184,7 +184,6 @@ class DefaultSpecs(Specs): "/usr/lib/udev/rules.d/40-redhat.rules", "/usr/local/lib/udev/rules.d/40-redhat.rules"]) etc_udev_oracle_asm_rules = glob_file(r"/etc/udev/rules.d/*asm*.rules") etcd_conf = simple_file("/etc/etcd/etcd.conf") - ethernet_interfaces = listdir("/sys/class/net", context=HostContext) ethtool = foreach_execute(ethernet.interfaces, "/sbin/ethtool %s") ethtool_S = foreach_execute(ethernet.interfaces, "/sbin/ethtool -S %s") ethtool_T = foreach_execute(ethernet.interfaces, "/sbin/ethtool -T %s") diff --git a/insights/tests/datasources/test_ethernet.py b/insights/tests/datasources/test_ethernet.py index 1feb779f54..d6f0be9b8d 100644 --- a/insights/tests/datasources/test_ethernet.py +++ b/insights/tests/datasources/test_ethernet.py @@ -6,7 +6,6 @@ from mock.mock import Mock from insights.tests import context_wrap -RELATIVE_PATH = "insights_commands/ethernet_interfaces" IP_LINK = """ 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000\\ link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00