search for: unixhttpconnect

Displaying 20 results from an estimated 20 matches for "unixhttpconnect".

2018 Jun 26
2
[PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
v2 was here: https://www.redhat.com/archives/libguestfs/2018-June/msg00109.html v3: - Added/fixed all suggestions from Nir in previous review. Q: I wasn't sure if we still need the "UnsupportedError" class so I left it in. Q: Does the Unix socket always have the same name? What happens if there's more than one transfer happening? I tested this both ways, and it worked both
2018 Jun 29
0
[PATCH] v2v: rhv-upload-plugin: Improve error handling
When optimizing the connection using unix socket, we handle these cases: - The local host is not an oVirt host (no /etc/vdsm/vdsm.id). - The local host is an oVirt host, but is not registered with engine. - Creating UnixHTTPConnection() fails. Unlikely and probably a bug in the plugin, but we can recover by using the https connection. The current code handle these cases silently, making it harder to understand why the unix socket optimization did no happen. Add debug message to make this clear. Also comment in the error h...
2018 Jun 26
2
Re: [PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...(can_flush, can_trim, can_zero, unix_socket)) > + > + # If we are connected to imageio on the local host and the > + # transfer features a unix_socket then we can reconnect to that. > + if host is not None and unix_socket is not None: > + try: > + http = UnixHTTPConnection(unix_socket) > + debug("optimizing connection using unix socket %r" % > unix_socket) > + except: > I think this should be: except Exception as e: debug("error using unix socket connection, using https connection: %s" % e) > +...
2018 Jun 21
0
[PATCH 2/2] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...features: flush=%r trim=%r zero=%r unix_socket=%r" % (can_flush, can_trim, can_zero, unix_socket)) + # If we are connected to the local host and the host features + # a unix_socket then we can reconnect to that. + if host and unix_socket: + try: + http = UnixHTTPConnection(unix_socket) + debug("optimizing connection using unix socket %r" % unix_socket) + except: + pass + # Save everything we need to make requests in the handle. return { 'can_flush': can_flush, @@ -451,3 +483,30 @@ def close(h):...
2018 Jun 26
0
[PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
..._socket=%r" % + (can_flush, can_trim, can_zero, unix_socket)) + + # If we are connected to imageio on the local host and the + # transfer features a unix_socket then we can reconnect to that. + if host is not None and unix_socket is not None: + try: + http = UnixHTTPConnection(unix_socket) + debug("optimizing connection using unix socket %r" % unix_socket) + except: + pass # Save everything we need to make requests in the handle. return { @@ -463,3 +499,22 @@ def close(h): raise connection.close() + +#...
2018 Jun 22
0
[PATCH v2 2/2] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...%r zero=%r unix_socket=%r" % + (can_flush, can_trim, can_zero, unix_socket)) + + # If we are connected to the local host and the host features + # a unix_socket then we can reconnect to that. + if host is not None and unix_socket is not None: + try: + http = UnixHTTPConnection(unix_socket) + debug("optimizing connection using unix socket %r" % unix_socket) + except: + pass # Save everything we need to make requests in the handle. return { @@ -451,3 +483,30 @@ def close(h): raise connection.close() + +#...
2018 Jun 22
4
v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
v1 was here: https://www.redhat.com/archives/libguestfs/2018-June/msg00099.html v2: - Just fixes the two problems noted in the review of the previous version. Rich.
2018 Jun 21
6
v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
These two patches add support for using a Unix domain socket to directly access imageio in the case where imageio is running on the conversion host (usually that means virt-v2v is running on the RHV node and something else -- eg. CFME scripts -- arranges that the RHV node is the same one running imageio). Conversions in the normal case are not affected - they happen over TCP as usual. This was
2018 Jun 27
0
Re: [PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...n_zero, unix_socket)) >> + >> + # If we are connected to imageio on the local host and the >> + # transfer features a unix_socket then we can reconnect to that. >> + if host is not None and unix_socket is not None: >> + try: >> + http = UnixHTTPConnection(unix_socket) >> + debug("optimizing connection using unix socket %r" % >> unix_socket) >> + except: >> > > I think this should be: > > except Exception as e: > debug("error using unix socket connection, using https conne...
2020 Jul 08
2
[PATCH] RFC: rhv-upload-plugin: Use imageio client
...-382,24 +259,6 @@ def close(h): connection.close() -# Modify http.client.HTTPConnection to work over a Unix domain socket. -# Derived from uhttplib written by Erik van Zijst under an MIT license. -# (https://pypi.org/project/uhttplib/) -# Ported to Python 3 by Irit Goihman. - - -class UnixHTTPConnection(HTTPConnection): - def __init__(self, path, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): - self.path = path - HTTPConnection.__init__(self, "localhost", timeout=timeout) - - def connect(self): - self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) -...
2020 Jul 09
2
Re: [PATCH] RFC: rhv-upload-plugin: Use imageio client
...> -# Modify http.client.HTTPConnection to work over a Unix domain socket. > > -# Derived from uhttplib written by Erik van Zijst under an MIT license. > > -# (https://pypi.org/project/uhttplib/) > > -# Ported to Python 3 by Irit Goihman. > > - > > - > > -class UnixHTTPConnection(HTTPConnection): > > Why drop this part? Not used now, imageio client includes this class: https://github.com/oVirt/ovirt-imageio/blob/24c59f2e0ace784d9c993f6044475bb370058e70/daemon/ovirt_imageio/_internal/backends/http.py#L610 > > Rest of the patch looks good and as you say above...
2018 Jun 25
1
Re: [PATCH v2 2/2] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...t features > + # a unix_socket then we can reconnect to that. > "We are connected" sounds strange. Maybe something like: if we started the transfer on the current host... > + if host is not None and unix_socket is not None: > + try: > + http = UnixHTTPConnection(unix_socket) > + debug("optimizing connection using unix socket %r" % > unix_socket) > + except: > + pass > # Save everything we need to make requests in the handle. > return { > @@ -451,3 +483,30 @@ def close(h): >...
2019 Nov 17
23
[PATCH 00/18] rvh-upload: Various fixes and cleanups
This series extract oVirt SDK and imageio code to make it eaiser to follow the code and improve error handing in open() and close(). The first small patches can be consider as fixes for downstream. Tested based on libguestfs v1.41.5, since I had trouble building virt-v2v and libguestfs from master. Nir Soffer (18): rhv-upload: Remove unused exception class rhv-upload: Check status more
2019 Nov 17
0
[PATCH 01/18] rhv-upload: Remove unused exception class
...gin.py b/v2v/rhv-upload-plugin.py index 896c17942..fdd2012f5 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -565,9 +565,6 @@ def close(h): # (https://pypi.org/project/uhttplib/) # Ported to Python 3 by Irit Goihman. -class UnsupportedError(Exception): - pass - class UnixHTTPConnection(HTTPConnection): def __init__(self, path, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): self.path = path -- 2.21.0
2020 Jul 09
2
Re: [PATCH] RFC: rhv-upload-plugin: Use imageio client
...x domain socket. > > > > -# Derived from uhttplib written by Erik van Zijst under an MIT license. > > > > -# (https://pypi.org/project/uhttplib/) > > > > -# Ported to Python 3 by Irit Goihman. > > > > - > > > > - > > > > -class UnixHTTPConnection(HTTPConnection): > > > > > > Why drop this part? > > > > Not used now, imageio client includes this class: > > https://github.com/oVirt/ovirt-imageio/blob/24c59f2e0ace784d9c993f6044475bb370058e70/daemon/ovirt_imageio/_internal/backends/http.py#L610 > > G...
2020 Jul 09
0
Re: [PATCH] RFC: rhv-upload-plugin: Use imageio client
...from the OCaml code? [...] > -# Modify http.client.HTTPConnection to work over a Unix domain socket. > -# Derived from uhttplib written by Erik van Zijst under an MIT license. > -# (https://pypi.org/project/uhttplib/) > -# Ported to Python 3 by Irit Goihman. > - > - > -class UnixHTTPConnection(HTTPConnection): Why drop this part? Rest of the patch looks good and as you say above both simplifies and improves performance. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt...
2019 Nov 18
15
[PATCH v2 00/11] rvh-upload: Various fixes and cleanups
This series extract oVirt SDK and imageio code to make it eaiser to follow the code and improve error handing in open() and close(). Tested with virt-v2v master. Changes since v1: - Rebase on merged patches from v1 - Fix regression introduced by "rhv-upload: Fix cleanup after errors" - Remove "rhv-upload: Try to remove disk on timeout" since it cannot succeed - Add more
2020 Jul 09
0
Re: [PATCH] RFC: rhv-upload-plugin: Use imageio client
...PConnection to work over a Unix domain socket. > > > -# Derived from uhttplib written by Erik van Zijst under an MIT license. > > > -# (https://pypi.org/project/uhttplib/) > > > -# Ported to Python 3 by Irit Goihman. > > > - > > > - > > > -class UnixHTTPConnection(HTTPConnection): > > > > Why drop this part? > > Not used now, imageio client includes this class: > https://github.com/oVirt/ovirt-imageio/blob/24c59f2e0ace784d9c993f6044475bb370058e70/daemon/ovirt_imageio/_internal/backends/http.py#L610 Good thing. Thanks, Rich. -- R...
2020 Jul 09
0
Re: [PATCH] RFC: rhv-upload-plugin: Use imageio client
...; > > -# Derived from uhttplib written by Erik van Zijst under an MIT license. > > > > > -# (https://pypi.org/project/uhttplib/) > > > > > -# Ported to Python 3 by Irit Goihman. > > > > > - > > > > > - > > > > > -class UnixHTTPConnection(HTTPConnection): > > > > > > > > Why drop this part? > > > > > > Not used now, imageio client includes this class: > > > https://github.com/oVirt/ovirt-imageio/blob/24c59f2e0ace784d9c993f6044475bb370058e70/daemon/ovirt_imageio/_internal/backends...
2020 Jan 10
7
[v2v PATCH 0/6] Various Python pycodestyle fixes
Fixes the majority of the pycodestyle issues in the Python scripts, and fix the existing test-v2v-python-syntax.sh to use pycodestyle to actually perform style checks. Pino Toscano (6): PEP 8: adapt whitespaces in lines PEP 8: move imports at the top PEP 8: adapt empty lines tests: find all the Python scripts for syntax checks -o rhv-upload: remove unused Python imports Revamp check