Commit bee1797 1 parent 9bdeb52 commit bee1797 Copy full SHA for bee1797
File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -81,12 +81,14 @@ def device_list_change(
81
81
frontends [front_vm ] = ass
82
82
to_attach [device .port_id ] = frontends
83
83
84
+ asyncio .ensure_future (resolve_conflicts_and_attach (ext , to_attach ))
85
+
86
+ async def resolve_conflicts_and_attach (ext , to_attach ):
84
87
for port_id , frontends in to_attach .items ():
85
88
if len (frontends ) > 1 :
86
89
# unique
87
90
device = tuple (frontends .values ())[0 ].device
88
- target_name = asyncio .ensure_future (
89
- confirm_device_attachment (device , frontends )).result ()
91
+ target_name = await confirm_device_attachment (device , frontends )
90
92
for front in frontends :
91
93
if front .name == target_name :
92
94
target = front
@@ -101,8 +103,7 @@ def device_list_change(
101
103
target = tuple (frontends .keys ())[0 ]
102
104
assignment = frontends [target ]
103
105
104
- asyncio .ensure_future (ext .attach_and_notify (target , assignment ))
105
-
106
+ await ext .attach_and_notify (target , assignment )
106
107
107
108
def compare_device_cache (vm , devices_cache , current_devices ):
108
109
# compare cached devices and current devices, collect:
You can’t perform that action at this time.
0 commit comments