<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 18, 2019 at 1:53 AM Nir Soffer <<a href="mailto:nsoffer@redhat.com">nsoffer@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Nov 18, 2019 at 1:05 AM Nir Soffer <<a href="mailto:nirsof@gmail.com" target="_blank">nirsof@gmail.com</a>> wrote:<br>
><br>
> If waiting for the disk to become OK times out, try to remove it. This<br>
> is likely to fail.<br>
<br>
Daniel, do you  think this can succeed?<br></blockquote><div><br></div><div>seems redundant, as remove disk will surely fail when the disk is still locked.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> ---<br>
>  v2v/rhv-upload-plugin.py | 7 ++++++-<br>
>  1 file changed, 6 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py<br>
> index 9b433bd7e..e79e7ddf7 100644<br>
> --- a/v2v/rhv-upload-plugin.py<br>
> +++ b/v2v/rhv-upload-plugin.py<br>
> @@ -575,6 +575,11 @@ def create_disk(connection):<br>
>          if disk.status == types.DiskStatus.OK:<br>
>              break<br>
>          if time.time() > endt:<br>
> -            raise RuntimeError("timed out waiting for disk to become unlocked")<br>
> +            try:<br>
> +                disk_service.remove()<br>
> +            except Exception as e:<br>
> +                debug("error removing disk %s: %s" % (<a href="http://disk.id" rel="noreferrer" target="_blank">disk.id</a>, e))<br>
</blockquote><div><br></div><div>the following couple of lines looks good, perhaps extract to another patch?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> +            raise RuntimeError(<br>
> +                "timed out waiting for disk %s to become unlocked" % <a href="http://disk.id" rel="noreferrer" target="_blank">disk.id</a>)<br></blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
><br>
>      return disk<br>
> --<br>
> 2.21.0<br>
><br>
<br>
</blockquote></div></div>