LCVcode / jockey

MIT License
2 stars 3 forks source link

KeyError when checking IP addresses on LXD's #17

Closed LCVcode closed 5 months ago

LCVcode commented 5 months ago

Querying machines based on IP fails when parsing LXDs. This is because LXD machine names (like 0/lxd/0) are not included in status["machines"].

python3 jockey.py -f tests/k8s-core-juju-status.json units ip=10.192.62.201
Traceback (most recent call last):
  File "jockey.py", line 843, in <module>
    main(args)
  File "jockey.py", line 800, in main
    print(" ".join(action(status, args.filters)))
  File "jockey.py", line 687, in filter_units
    if not all(
  File "jockey.py", line 688, in <genexpr>
    any(check_filter_match(i_filter, ip) for ip in ips)
  File "jockey.py", line 688, in <genexpr>
    any(check_filter_match(i_filter, ip) for ip in ips)
  File "jockey.py", line 536, in machine_to_ips
    for ip in status["machines"][machine]["ip-addresses"]:
KeyError: '0/lxd/0'
LCVcode commented 5 months ago

Closed by #18