search for: basehttprequesthandler

Displaying 10 results from an estimated 10 matches for "basehttprequesthandler".

2018 Oct 15
3
Re: [PATCH v2 3/3] v2v: -o rhv-upload: Add a test.
...; not part of the SDK, and may be replaced by real imageio server later. > > Well possibly, but it was very convenient to put it in the class here, > and this test is meant for running completely standalone without any > other service available. > > > > +class RequestHandler(BaseHTTPRequestHandler): > > > > > > > This request handler is using HTTP/1.0, and will close the connection > after > > every request. This is not a good implementation of the imageio server, > and > > also > > hides bugs in this code. > > > > Should be fixed by a...
2018 Nov 20
2
Re: [PATCH v2 3/3] v2v: -o rhv-upload: Add a test.
...erver later. > > > > > > Well possibly, but it was very convenient to put it in the class here, > > > and this test is meant for running completely standalone without any > > > other service available. > > > > > > > > +class RequestHandler(BaseHTTPRequestHandler): > > > > > > > > > > > > > This request handler is using HTTP/1.0, and will close the connection > > > after > > > > every request. This is not a good implementation of the imageio server, > > > and > > > > also >...
2018 Oct 09
2
Re: [PATCH v2 3/3] v2v: -o rhv-upload: Add a test.
...reate a background thread running a web server which is > +# simulating the imageio server. > This functionality should be separated from the fake SDK module, since it is not part of the SDK, and may be replaced by real imageio server later. > + > +from http.server import HTTPServer, BaseHTTPRequestHandler > +import random > +import threading > + > +# Choose a random port number in range [50000,59999] > +imageio_port = random.randint(50000,60000) > + > +class RequestHandler(BaseHTTPRequestHandler): > This request handler is using HTTP/1.0, and will close the connection after...
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
2018 Sep 20
0
[PATCH v2 3/3] v2v: -o rhv-upload: Add a test.
...: + return [ StorageDomain() ] + +class VmsService(object): + def add(self, vm): + return vm + + def list(self, search=None): + return [] + +# Create a background thread running a web server which is +# simulating the imageio server. + +from http.server import HTTPServer, BaseHTTPRequestHandler +import random +import threading + +# Choose a random port number in range [50000,59999] +imageio_port = random.randint(50000,60000) + +class RequestHandler(BaseHTTPRequestHandler): + def do_OPTIONS(self): + self.send_response(200) + self.send_header("Content-type", &quot...
2018 Sep 20
7
[PATCH v2 0/3] v2v: -o rhv-upload: Add a test.
v1 was here: https://www.redhat.com/archives/libguestfs/2018-September/msg00121.html v2: - Rewrote patch 2 from scratch so it incorporates Nir's suggestions. - Add fake module to EXTRA_DIST. - Retested. Unfortunately I am no longer able to test the ordinary conversion path because ovirtsdk4 is incompatible with Fedora 29 / Python 3.7:
2018 Oct 15
0
Re: [PATCH v2 3/3] v2v: -o rhv-upload: Add a test.
...SDK module, since it is > not part of the SDK, and may be replaced by real imageio server later. Well possibly, but it was very convenient to put it in the class here, and this test is meant for running completely standalone without any other service available. > > +class RequestHandler(BaseHTTPRequestHandler): > > > > This request handler is using HTTP/1.0, and will close the connection after > every request. This is not a good implementation of the imageio server, and > also > hides bugs in this code. > > Should be fixed by adding: > > protocol_version = "H...
2018 Oct 15
0
Re: [PATCH v2 3/3] v2v: -o rhv-upload: Add a test.
...be replaced by real imageio server later. > > > > Well possibly, but it was very convenient to put it in the class here, > > and this test is meant for running completely standalone without any > > other service available. > > > > > > +class RequestHandler(BaseHTTPRequestHandler): > > > > > > > > > > This request handler is using HTTP/1.0, and will close the connection > > after > > > every request. This is not a good implementation of the imageio server, > > and > > > also > > > hides bugs in this code....
2018 Nov 20
0
Re: [PATCH v2 3/3] v2v: -o rhv-upload: Add a test.
...ule/ovirtsdk4/__init__.py b/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py > index 84b9d56aa..8d1058d67 100644 > --- a/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py > +++ b/v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py > @@ -146,7 +146,7 @@ class RequestHandler(BaseHTTPRequestHandler): > self.end_headers() > > def discard_request(self): > - length = self.headers['Content-Length'] > + length = self.headers.get('Content-Length') > if length: > length = int(length) > content =...
2018 Sep 19
4
[PATCH 0/3] v2v: -o rhv-upload: Add a test.
This adds a test of -o rhv-upload. Obviously for an upstream test we cannot require a working oVirt server. This test works by faking the ovirtsdk4 Python module, setting PYTHONPATH so that the fake module is picked up instead of the real module (if installed). However it's more complex than that because the nbdkit plugin also expects to talk to a working imageio HTTPS server. Therefore