virtkvm icon indicating copy to clipboard operation
virtkvm copied to clipboard

Problem with python

Open Punkado opened this issue 3 years ago • 0 comments

Hello,

Since a month, i am having a error from python when i curl the URL:

curl -X POST -H 'Content-Type: application/json' -H 'X-Secret: 6pys8qJGQr5S3ptpL72hPeBc8cYrwFRF' -d '{"to": "guest"}' http://192.168.1.238:5556/switch {"error":"Traceback (most recent call last):\n File \"/usr/lib/python3.9/site-packages/virtkvm/__init__.py\", line 157, in app_switch\n cases[request.json[\"to\"]]()\n File \"/usr/lib/python3.9/site-packages/virtkvm/__init__.py\", line 132, in switch_to_guest\n self.virt.attach_devices(self.config.devices)\n File \"/usr/lib/python3.9/site-packages/virtkvm/__init__.py\", line 83, in attach_devices\n dev = self.get_device_by_ids(ids)\n File \"/usr/lib/python3.9/site-packages/virtkvm/__init__.py\", line 75, in get_device_by_ids\n for dev in self.get_devices():\n File \"/usr/lib/python3.9/site-packages/virtkvm/__init__.py\", line 64, in get_devices\n if dev[\"@type\"] == \"usb\":\nTypeError: string indices must be integers\n","success":true}

Unfortunately, i dont have the python skills to debug it, anyone having similar problems?

Thanks!

Punkado avatar Oct 05 '21 10:10 Punkado