Skip to content

Commit

Permalink
storage: simplify coroutine handling
Browse files Browse the repository at this point in the history
Suggested by @woju
  • Loading branch information
marmarek committed Jun 23, 2017
1 parent 9242202 commit f976f7e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions qubes/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,8 @@ def clone_volume(self, src_vm, name):
# clone/import functions may be either synchronous or asynchronous
# in the later case, we need to wait for them to finish
if asyncio.iscoroutine(clone_op_ret):
self.vm.volumes[name] = yield from clone_op_ret
else:
self.vm.volumes[name] = clone_op_ret
clone_op_ret = yield from clone_op_ret
self.vm.volumes[name] = clone_op_ret
return self.vm.volumes[name]

@asyncio.coroutine
Expand Down

0 comments on commit f976f7e

Please sign in to comment.