kcli icon indicating copy to clipboard operation
kcli copied to clipboard

kcli list vms fails if a domain is stopped AND it has a host usb device passed through

Open aussielunix opened this issue 3 years ago • 0 comments

Bug

I have a domain(vm) that has a host USB device passed through.
If I run kcli list vms whilst the domain is running then I get a list of domains as expected. If I run kcli list vms whilst the domain is in state shut off then kcli crashes.

I don't know Python but I think this is where the issue is.

[~/bin/kcli]
lunix@lumbergh]  (master) -> git --no-pager reflog 
b6018997 (HEAD -> master, origin/master, origin/HEAD) HEAD@{0}: pull: Fast-forward
689a1224 HEAD@{1}: clone: from github.com:karmab/kcli.git


[~/bin/kcli]
lunix@lumbergh]  (master) -> python --version
Python 3.10.6
[~/bin/kcli]
lunix@lumbergh]  (master) -> kcli -C gts list vms
+--------+--------+------------+--------+------+---------+
|  Name  | Status |     Ip     | Source | Plan | Profile |
+--------+--------+------------+--------+------+---------+
|  dns1  |   up   | 10.0.99.11 |        |      |         |
| foobar |  down  |            |        |      |         |
| rospxe |   up   |            |        |      |         |
+--------+--------+------------+--------+------+---------+
[~/bin/kcli]
lunix@lumbergh]  (master) -> 
[~/bin/kcli]
lunix@lumbergh]  (master) -> kcli -C gts list vms
Traceback (most recent call last):
  File "/home/lunix/.local/bin/kcli", line 33, in <module>
    sys.exit(load_entry_point('kcli', 'console_scripts', 'kcli')())
  File "/home/lunix/bin/kcli/kvirt/cli.py", line 5066, in cli
    args.func(args)
  File "/home/lunix/bin/kcli/kvirt/cli.py", line 634, in list_vm
    _list = config.k.list()
  File "/home/lunix/bin/kcli/kvirt/providers/kvm/__init__.py", line 1530, in list
    vms.append(self.info(vm.name(), vm=vm))
  File "/home/lunix/bin/kcli/kvirt/providers/kvm/__init__.py", line 1741, in info
    bus, slot, function = address.get('bus'), address.get('slot'), address.get('function')
AttributeError: 'NoneType' object has no attribute 'get'

Please let me know what else you may need to debug this.

Mick

aussielunix avatar Sep 26 '22 08:09 aussielunix