search for: create_default_context

Displaying 20 results from an estimated 33 matches for "create_default_context".

2018 Sep 19
1
Re: [PATCH 2/3] v2v: -o rhv-upload: Only set SSL context for https connections.
...Richard W.M. Jones <rjones@redhat.com> wrote: > For real imageio servers the destination will always be https. This > change has no effect there. > > However when testing we want to use an http server for simplicity. As > there is no cafile in this case the call to > ssl.create_default_context().load_verify_locations(cafile=...) will fail. > --- > v2v/rhv-upload-plugin.py | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py > index 5cd6d5cab..6e35b5057 100644 > --- a/v2v/rhv-upload-plugin...
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
2018 Sep 19
0
[PATCH 2/3] v2v: -o rhv-upload: Only set SSL context for https connections.
For real imageio servers the destination will always be https. This change has no effect there. However when testing we want to use an http server for simplicity. As there is no cafile in this case the call to ssl.create_default_context().load_verify_locations(cafile=...) will fail. --- v2v/rhv-upload-plugin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py index 5cd6d5cab..6e35b5057 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py...
2018 Dec 07
2
[PATCH] v2v: -o rhv-upload: Fix upload when using https
..."environment, eg. on an oVirt node.") destination_url = urlparse(transfer.transfer_url) else: destination_url = urlparse(transfer.proxy_url) if destination_url.scheme == "https": context = \ ssl.create_default_context(purpose = ssl.Purpose.SERVER_AUTH, - cafile = cafile) + cafile = params['rhv_cafile']) if params['insecure']: context.check_hostname = False context.verify_mode = ssl.CERT_...
2018 Sep 20
0
[PATCH v2 2/3] v2v: -o rhv-upload: Only set SSL context for https connections.
...ions(-) diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py index 5cd6d5cab..1a217b6dc 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -207,14 +207,25 @@ def open(readonly): else: destination_url = urlparse(transfer.proxy_url) - context = ssl.create_default_context() - context.load_verify_locations(cafile = params['rhv_cafile']) - - http = HTTPSConnection( - destination_url.hostname, - destination_url.port, - context = context - ) + if destination_url.scheme == "https": + context = \ + ssl.c...
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 Dec 07
0
Re: [PATCH] v2v: -o rhv-upload: Fix upload when using https
...uot;environment, eg. on an oVirt node.") > destination_url = urlparse(transfer.transfer_url) > else: > destination_url = urlparse(transfer.proxy_url) > > if destination_url.scheme == "https": > context = \ > ssl.create_default_context(purpose = ssl.Purpose.SERVER_AUTH, > - cafile = cafile) > + cafile = params['rhv_cafile']) > if params['insecure']: > context.check_hostname = False > contex...
2018 Dec 07
1
Re: [PATCH] v2v: -o rhv-upload: Fix upload when using https
...node.") > > destination_url = urlparse(transfer.transfer_url) > > else: > > destination_url = urlparse(transfer.proxy_url) > > > > if destination_url.scheme == "https": > > context = \ > > ssl.create_default_context(purpose = > ssl.Purpose.SERVER_AUTH, > > - cafile = cafile) > > + cafile = params['rhv_cafile']) > > if params['insecure']: > > context.check_hostname = False...
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
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
2018 Feb 22
0
[PATCH 5/5] v2v: Add -o rhv-upload output mode.
...+ +if %s: + if transfer.transfer_url is None: + print(\"Direct upload to host not supported, requires ovirt-engine >= 4.2\") + sys.exit(1) + destination_url = urlparse(transfer.transfer_url) +else: + destination_url = urlparse(transfer.proxy_url) + +context = ssl.create_default_context() +context.load_verify_locations(cafile = %s) + +proxy_connection = HTTPSConnection( + destination_url.hostname, + destination_url.port, + context = context +) + +image_path = %s +image_size = %Ld + +proxy_connection.putrequest(\"PUT\", destination_url.path) +proxy_connection.put...
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
2018 Feb 27
0
[PATCH v2 3/3] v2v: Add -o rhv-upload output mode.
...Direct upload to host not supported, requires ovirt-engine >= 4.2 and only works when virt-v2v is run within the oVirt/RHV environment, eg. on an ovirt node.\") + destination_url = urlparse(transfer.transfer_url) +else: + destination_url = urlparse(transfer.proxy_url) + +context = ssl.create_default_context() +context.load_verify_locations(cafile = %s) + +proxy_connection = HTTPSConnection( + destination_url.hostname, + destination_url.port, + context = context +) + +image_path = %s +image_size = %Ld + +proxy_connection.putrequest(\"PUT\", destination_url.path) +proxy_connection.put...
2018 Feb 27
5
[PATCH v2 0/3] v2v: Add -o rhv-upload output mode.
This patch set is still for discussion only. See 3/3 for the current list of problems. However this will upload an image to an oVirt or RHV server, although you must have absolutely the latest snapshot version of 4.2 for it to work. Rich.
2018 Feb 22
2
Re: [PATCH 5/5] v2v: Add -o rhv-upload output mode.
..._url is None: > + print(\"Direct upload to host not supported, requires ovirt-engine >= 4.2\") > + sys.exit(1) > + destination_url = urlparse(transfer.transfer_url) > +else: > + destination_url = urlparse(transfer.proxy_url) > + > +context = ssl.create_default_context() > +context.load_verify_locations(cafile = %s) > + > +proxy_connection = HTTPSConnection( > + destination_url.hostname, > + destination_url.port, > + context = context > +) > + > +image_path = %s > +image_size = %Ld > + > +proxy_connection.putrequest(\&...
2018 Feb 22
11
[PATCH 0/5] v2v: Add -o rhv-upload output mode.
The first four patches are straightforward. The final patch adds the -o rhv-upload output mode. It is still spooling into a temporary file because I've had some trouble getting streaming conversions working. There are other problems as outlined in the commit message, so this patch is not ready for upstream but is good for discussion. Also I hit this, which I'm assuming for now will be
2020 Jul 08
2
[PATCH] RFC: rhv-upload-plugin: Use imageio client
...ransfer_url) - else: - return urlparse(transfer.proxy_url) - - -def create_http(url): - """ - Create http connection for transfer url. - - Returns HTTPConnection. - """ - if url.scheme == "https": - context = \ - ssl.create_default_context(purpose=ssl.Purpose.SERVER_AUTH, - cafile=params['rhv_cafile']) - if params['insecure']: - context.check_hostname = False - context.verify_mode = ssl.CERT_NONE - - return HTTPSConnection(url.hostname, url.port...
2018 Mar 01
7
[PATCH v3 0/6] v2v: Add -o rhv-upload output mode.
v2 -> v3: - Lots of code cleanups. - Documentation. However this is still spooling the file into a temporary before the upload. It turns out that fixing this is going to require a small change to qemu. Rich.
2018 Mar 08
6
[PATCH v5 0/4] v2v: Add -o rhv-upload output mode.
Mainly minor fixes and code cleanups over the v4 patch. There are still several problems with this patch, but it is in a reviewable state, especially the Python code. Rich.
2018 Mar 08
0
[PATCH v5 4/4] v2v: Add -o rhv-upload output mode.
...o host not supported, requires ovirt-engine >= 4.2 and only works when virt-v2v is run within the oVirt/RHV environment, eg. on an ovirt node.") + destination_url = urlparse(transfer.transfer_url) + else: + destination_url = urlparse(transfer.proxy_url) + + context = ssl.create_default_context() + context.load_verify_locations(cafile = params['rhv_cafile']) + + http = HTTPSConnection( + destination_url.hostname, + destination_url.port, + context = context + ) + + # Save everything we need to make requests in the handle. + return { + '...