Skip to content

Commit

Permalink
q-dev: update utils
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Oct 14, 2024
1 parent a23262b commit e5ea7bf
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions qubesusbproxy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,16 @@ def compare_device_cache(vm, devices_cache, current_devices):


def confirm_device_attachment(device, frontends) -> str:
guivm = 'dom0' # TODO

try:
# pylint: disable=consider-using-with
proc = subprocess.Popen(
["attach-confirm", guivm,
device.backend_domain.name, device.port_id,
device.description,
["attach-confirm", device.backend_domain.name,
device.port_id, device.description,
*[f.name for f in frontends.keys()]],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
(target_name, _) = proc.communicate()
return target_name.decode()
except Exception as exc:
print(exc, file=sys.stderr)
print("attach-confirm", exc, file=sys.stderr)
return ""

0 comments on commit e5ea7bf

Please sign in to comment.