From 9bac5487ef61c3795d48bb156f4ebf155c2fc5cb Mon Sep 17 00:00:00 2001 From: Benjamin Collet Date: Tue, 13 Mar 2018 09:15:23 +0100 Subject: [PATCH] Hide disabled ports and ports on disabled devices --- client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client.py b/client.py index 1591020..a25acda 100755 --- a/client.py +++ b/client.py @@ -44,8 +44,12 @@ def search_ports(args): return for port in data['ports'].itervalues(): - print "=" * 80 device = call_api(params, 'devices/%s' % port['device_id']) + + if device['device']['disabled'] == "1": continue + if port['disabled'] == "1": continue + + print "=" * 80 print_data("Device", device['device']['hostname']) print_data("", "%s/device/device=%s" % (params['base_url'], port['device_id'])) print_data("Port", port['port_label_short'])