Hellboycc / netbox

A simple and flexible CLI tool for network
MIT License
1 stars 0 forks source link

The wireless feature is having problems with macOS (Big Sur) #8

Open luoyingchuan opened 1 year ago

luoyingchuan commented 1 year ago

When i used the tool on macOS (Big Sur, version 11.4) to check the information of current wifi connection, it returned an big error as below:

╰─ netbox-cli wlan current
Traceback (most recent call last):
  File "/Users/luoyc/Desktop/Projects/netbox/.venv/bin/netbox-cli", line 33, in <module>
    sys.exit(load_entry_point('netbox', 'console_scripts', 'netbox-cli')())
  File "/Users/luoyc/Desktop/Projects/netbox/.venv/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/luoyc/Desktop/Projects/netbox/.venv/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/luoyc/Desktop/Projects/netbox/.venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/luoyc/Desktop/Projects/netbox/.venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/luoyc/Desktop/Projects/netbox/.venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/luoyc/Desktop/Projects/netbox/.venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/luoyc/Desktop/Projects/netbox/.venv/lib/python3.10/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/Users/luoyc/Desktop/Projects/netbox/netbox/scripts/command.py", line 53, in current
    info = netbox.current_wifi_info
  File "/Users/luoyc/Desktop/Projects/netbox/netbox/core.py", line 56, in current_wifi_info
    ret = self._wifi_adapter.get_current_network()
  File "/Users/luoyc/Desktop/Projects/netbox/netbox/wifi.py", line 44, in get_current_network
    return self._get_current_wifi_info()
  File "/Users/luoyc/Desktop/Projects/netbox/netbox/wifi.py", line 60, in _get_current_wifi_info
    (k, v) = line.split(":")
ValueError: too many values to unpack (expected 2)

Please fix the bug so that the tool can be working normally on macOS (Big Sur , version 11.4)