Skip to content

Commit c146a16

Browse files
committed
pethtool: show if a device is active or not
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 13ec0f5 commit c146a16

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ethtool-cmd.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,15 @@ def show_driver(interface, args = None):
7979

8080
def run_cmd(cmd, interface, args):
8181
global tab
82+
83+
active_devices = ethtool.get_active_devices()
8284
if not interface:
8385
tab = " "
8486
for interface in ethtool.get_devices():
85-
print "%s:" % interface
87+
inactive = " (not active)"
88+
if interface in active_devices:
89+
inactive = ""
90+
print "%s%s:" % (interface, inactive)
8691
cmd(interface, args)
8792
else:
8893
cmd(interface, args)

0 commit comments

Comments
 (0)