Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Exception if invalid interface name is given on CLI #24

Open
lowell80 opened this issue Jun 27, 2019 · 0 comments
Open

Exception if invalid interface name is given on CLI #24

lowell80 opened this issue Jun 27, 2019 · 0 comments
Assignees

Comments

@lowell80
Copy link
Member

If an invalid interface name is provided (like --interface 0), than an ugly exception message is provided instead of a human readable error. The user should be given better feedback.

Version:

python kintyre_speedtest.py --version
0.3.9

Example output:

# python kintyre_speedtest.py --interface 0

interface:  ['0']
mode=random    interface:  ['0']
DEBUG:  Payload --> https://X.XX.XX.XX:8443/services/collector/event  :  {"action": "ping", "hostname": "BLAH", "agent": {"name": "Lowell's Laptop", "org": "kintyre.co"}}
   Status code = 200
DEBUG:  iterfaces for testing: InterfaceInfo(ip=None, dev=None, meta={'_error': 'No non-blacklisted interfaces found.'})
DEBUG:  get_macosx_hardware() returns: {0: {'hardware_port': 'LPSS Serial Adapter (1)'}, 1: {'hardware_port': 'LPSS Serial Adapter (2)'}, 'en9': {'device': 'en9', 'hardware_port': 'AX88179 USB 3.0 to Gigabit Ethernet', 'ethernet_address': 'XXXXX'}, 'en0': {'device': 'en0', 'hardware_port': 'Wi-Fi', 'ethernet_address': XXXXX'}, 'en6': {'device': 'en6', 'hardware_port': 'Bluetooth PAN', 'ethernet_address': '8c:85:XXXXX'}, 'en1': {'device': 'en1', 'hardware_port': '..... REMOVE INFO .... }
Missing netsh
DEBUG:  get_windows_netsh() returns: None
Missing iwconfig
DEBUG:  get_linux_iwconfig() returns: None
Missing lshw
DEBUG:  get_linux_lshw() returns: None
Traceback (most recent call last):
  File "kintyre_speedtest.py", line 843, in <module>
    cli()
  File "kintyre_speedtest.py", line 839, in cli
    main(interfaces, out)
  File "kintyre_speedtest.py", line 381, in main
    info = if_.meta
AttributeError: 'NoneType' object has no attribute 'meta'

Also iterfaces should be interfaces.

@lowell80 lowell80 changed the title Exception if invalid interfacen ame Exception if invalid interface name is given on CLI Jun 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants