Richard W.M. Jones
2018-Aug-28 21:22 UTC
[Libguestfs] [PATCH RHEL 7.6 LP] RHEL 7.6 LP: Convert Python 3 to Python 2.
Nir, can you confirm this is correct for RHEL 7 / Python 2? Rich.
Richard W.M. Jones
2018-Aug-28 21:22 UTC
[Libguestfs] [PATCH RHEL 7.6 LP] RHEL 7.6 LP: Convert Python 3 to Python 2.
From: "Richard W.M. Jones" <rjones@redhat.com> Updates commit 8f250c00c8b028a614815f63b2713748504d7ef9 for RHEL 7.6 LP. --- v2v/rhv-upload-plugin.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py index 42c7065..3e561e6 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -383,8 +383,9 @@ def pwrite(h, buf, offset): try: http.send(buf) - except BrokenPipeError: - pass + except socket.error as e: + if e.args[0] not in (errno.EPIPE, errno.ESHUTDOWN): + raise r = http.getresponse() if r.status != 200: @@ -446,8 +447,9 @@ def emulate_zero(h, count, offset): http.send(buf) count -= len(buf) http.send(buffer(buf, 0, count)) - except BrokenPipeError: - pass + except socket.error as e: + if e.args[0] not in (errno.EPIPE, errno.ESHUTDOWN): + raise r = http.getresponse() if r.status != 200: -- 1.8.3.1
Nir Soffer
2018-Aug-28 21:25 UTC
Re: [Libguestfs] [PATCH RHEL 7.6 LP] RHEL 7.6 LP: Convert Python 3 to Python 2.
On Wed, Aug 29, 2018 at 12:22 AM Richard W.M. Jones <rjones@redhat.com> wrote:> From: "Richard W.M. Jones" <rjones@redhat.com> > > Updates commit 8f250c00c8b028a614815f63b2713748504d7ef9 for RHEL 7.6 LP. > --- > v2v/rhv-upload-plugin.py | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py > index 42c7065..3e561e6 100644 > --- a/v2v/rhv-upload-plugin.py > +++ b/v2v/rhv-upload-plugin.py > @@ -383,8 +383,9 @@ def pwrite(h, buf, offset): > > try: > http.send(buf) > - except BrokenPipeError: > - pass > + except socket.error as e: > + if e.args[0] not in (errno.EPIPE, errno.ESHUTDOWN): > + raise > > r = http.getresponse() > if r.status != 200: > @@ -446,8 +447,9 @@ def emulate_zero(h, count, offset): > http.send(buf) > count -= len(buf) > http.send(buffer(buf, 0, count)) > - except BrokenPipeError: > - pass > + except socket.error as e: > + if e.args[0] not in (errno.EPIPE, errno.ESHUTDOWN): > + raise > > r = http.getresponse() > if r.status != 200: > -- > 1.8.3.1 >Looks correct. Nir
Apparently Analagous Threads
- [PATCH] v2v: rhv-upload-plugin: Use BrokenPipeError
- [PATCH RHEL 7.6 LP] RHEL 7.6 LP: Convert Python 3 to Python 2.
- [PATCH] v2v: -o rhv-upload: Fix emulated zero
- [PATCH 0/2] v2v: rhv-upload-plugin: Improve error handling
- [PATCH v2] v2v: -o rhv-upload: Log full imageio response on failure.