search for: urllib

Displaying 20 results from an estimated 55 matches for "urllib".

2020 Feb 24
2
Re: [PATCH v2v v2 2/2] rhv-upload: Check that rhv-disk-uuid is not already taken (RHBZ#1789279)
...3e6260e97f4..413ad53b05ab 100644 > --- a/v2v/rhv-upload-plugin.py > +++ b/v2v/rhv-upload-plugin.py > @@ -26,6 +26,9 @@ import ssl > import sys > import time > > +import nbdkit > +import errno > + > from http.client import HTTPSConnection, HTTPConnection > from urllib.parse import urlparse > > @@ -461,6 +464,15 @@ def create_disk(connection): > system_service = connection.system_service() > disks_service = system_service.disks_service() > > + uuid = params.get('rhv_disk_uuid') > + if uuid is not None: > +...
2020 Jan 23
5
[v2v PATCH 0/2] rhv-upload: Validate UUIDs and check they don't exist already
My stab at fixing this: https://bugzilla.redhat.com/show_bug.cgi?id=1789279 It took me quite some time to go through the whole rfc 4122 just to realize we do not need to do anything with the versions. Martin Kletzander (2): rhv-upload: Validate UUIDs passed to -oo rhv-disk-uuid (RHBZ#1789279) rhv-upload: Check that rhv-disk-uuid is not already taken (RHBZ#1789279)
2010 Nov 05
3
Unable to create (and keep) guest
...;] else: kernelurl = installer + "/netboot/xen/vmlinuz" if xm_vars.env.get(''install-ramdisk''): ramdiskurl = xm_vars.env[''install-ramdisk''] else: ramdiskurl = installer + "/netboot/xen/initrd.gz" import urllib class MyUrlOpener(urllib.FancyURLopener): def http_error_default(self, req, fp, code, msg, hdrs): raise IOError("%s %s" % (code, msg)) urlopener = MyUrlOpener() try: print "Fetching %s" % kernelurl kernel, _ = urlopener.retrieve(k...
2018 Mar 12
1
[PATCH RHEL 7] RHEL 7: -o rhv-upload: Use Python 2 instead of Python
For interest only, here is the patch required to make -o rhv-upload work with Python 2 (for RHEL 7). I don't think we want this upstream. A couple of remarks: * It's supposed to be possible to add ‘coding: utf-8’ to the top of .py files to make Python 2 accept that the file is UTF-8 (otherwise it gives an error on loading). However I added this and it didn't appear to make any
2015 Apr 13
2
Check feed connected, active - IceCast 2.4.x
...<source> tags to find out if the sources are connected. > > Thanks, but no I am not scraping/parsing that. I despise the whole > concept of "scraping" sites like this, there is already one piece of > software doing this as it is in my arena. > > doing a: > > urllib.urlopen("http://domain/source").getcode() > > just returns a 200 even if the actual source is down, and the source is > on a fall back. If I were following http expectations I should get 302, > temp redirection as used widely, or 307 if you stick to the strict > standard. &...
2018 Jun 15
1
[PATCH] v2v: rhv-upload: Disable Nagle algorithm
...ad-plugin.py b/v2v/rhv-upload-plugin.py index ed99cc7a9..f8cd37e9f 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -23,7 +23,7 @@ import ssl import sys import time -from http.client import HTTPSConnection +from http.client import HTTPSConnection as _HTTPSConnection from urllib.parse import urlparse import ovirtsdk4 as sdk @@ -38,6 +38,18 @@ timeout = 5*60 # is no formal API here. params = None +class HTTPSConnection(_HTTPSConnection): + def connect(self): + """ + Using TCP_NO_DELAY avoids delays when sending small payload, such as +...
2020 Jan 29
4
[PATCH v2v v2 0/2] rhv-upload: Validate UUIDs and check they don't exist already
My stab v2 at fixing this: https://bugzilla.redhat.com/show_bug.cgi?id=1789279 It took me quite some time to go through the whole rfc 4122 just to realize we do not need to do anything with the versions. v2: - Use EEXIST instead of EINVAL - Put the colliding UUID into the error - Do not evaluate the PCRE needlessly multiple times v1:
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
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 Aug 22
0
[PATCH disk-sync 4/5] Require libnbd >= 0.9.8 and fail hard if it's an earlier version.
...b/wrapper/disk_sync.py index e830193..e655ead 100644 --- a/wrapper/disk_sync.py +++ b/wrapper/disk_sync.py @@ -4,6 +4,8 @@ from pyVmomi import vim from pyVim.connect import SmartConnect, Disconnect from pyVim.task import WaitForTask +from packaging import version + import nbd from six.moves.urllib.parse import urlparse, unquote @@ -15,6 +17,8 @@ import ssl import sys import json +NBD_MIN_VERSION = version.parse("0.9.8") + LOG_FORMAT_TIME = '[%(asctime)s] ' LOG_FORMAT_MSG = ': %(message)s' @@ -582,6 +586,13 @@ def main(): '''TODO: Add some de...
2020 Jan 23
0
[v2v PATCH 2/2] rhv-upload: Check that rhv-disk-uuid is not already taken (RHBZ#1789279)
...rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py index d3e6260e97f4..edb2699214c2 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -26,6 +26,9 @@ import ssl import sys import time +import nbdkit +import errno + from http.client import HTTPSConnection, HTTPConnection from urllib.parse import urlparse @@ -461,6 +464,15 @@ def create_disk(connection): system_service = connection.system_service() disks_service = system_service.disks_service() + uuid = params.get('rhv_disk_uuid') + if uuid is not None: + try: + disks_service.disk_s...
2020 Jan 29
0
[PATCH v2v v2 2/2] rhv-upload: Check that rhv-disk-uuid is not already taken (RHBZ#1789279)
...rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py index d3e6260e97f4..413ad53b05ab 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -26,6 +26,9 @@ import ssl import sys import time +import nbdkit +import errno + from http.client import HTTPSConnection, HTTPConnection from urllib.parse import urlparse @@ -461,6 +464,15 @@ def create_disk(connection): system_service = connection.system_service() disks_service = system_service.disks_service() + uuid = params.get('rhv_disk_uuid') + if uuid is not None: + try: + disks_service.disk_s...
2020 Feb 24
0
Re: [PATCH v2v v2 2/2] rhv-upload: Check that rhv-disk-uuid is not already taken (RHBZ#1789279)
...--- a/v2v/rhv-upload-plugin.py >> +++ b/v2v/rhv-upload-plugin.py >> @@ -26,6 +26,9 @@ import ssl >> import sys >> import time >> >> +import nbdkit >> +import errno >> + >> from http.client import HTTPSConnection, HTTPConnection >> from urllib.parse import urlparse >> >> @@ -461,6 +464,15 @@ def create_disk(connection): >> system_service = connection.system_service() >> disks_service = system_service.disks_service() >> >> + uuid = params.get('rhv_disk_uuid') >> + if uuid i...
2015 Apr 11
0
Check feed connected, active - IceCast 2.4.x
...> my IceCast server to make sure IceCast is up and running, and the feeds > connected... obviously not a verification of audio, yet, but at least the > source is sending data to the IceCast server. > > I can check that IceCast is running doing a simple: > > response_code = urllib.urlopen("http:/server:8000").getcode() Two slashes missing. > If I get a 200, IceCast is up/running. > > For feeds what would be the best URL to check and the response? > > NOTE: Feeds if THE SOURCE is NOT SENDING, FAIL OVER to a fail over > mount!! > > So...
2015 Apr 13
0
Check feed connected, active - IceCast 2.4.x
...he admin/stats.xml file *is* the API interface. It's for usage such as yours. within /admin: stuff ending with .xsl is for non-API, stuff with no dot in the name or ending in .xml are for API usage. What you will get is a well formed XML document. Have a look at it! > doing a: > > urllib.urlopen("http://domain/source").getcode() > > just returns a 200 even if the actual source is down, and the source is > on a fall back. If I were following http expectations I should get 302, > temp redirection as used widely, or 307 if you stick to the strict > standar...
2015 Apr 13
0
Check feed connected, active - IceCast 2.4.x
...if the sources are connected. >> >> Thanks, but no I am not scraping/parsing that. I despise the whole >> concept of "scraping" sites like this, there is already one piece of >> software doing this as it is in my arena. >> >> doing a: >> >> urllib.urlopen("http://domain/source").getcode() >> >> just returns a 200 even if the actual source is down, and the source is >> on a fall back. If I were following http expectations I should get 302, >> temp redirection as used widely, or 307 if you stick to the strict...
2018 Jun 26
2
Re: [PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...-upload-plugin.py > @@ -19,11 +19,12 @@ > import builtins > import json > import logging > +import socket > import ssl > import sys > import time > > -from http.client import HTTPSConnection > +from http.client import HTTPSConnection, HTTPConnection > from urllib.parse import urlparse > > import ovirtsdk4 as sdk > @@ -56,6 +57,28 @@ def debug(s): > print(s, file=sys.stderr) > sys.stderr.flush() > > +def find_host(connection): > + """Return the current host object or None.""" > I...
2019 Aug 22
7
[PATCH disk-sync 0/5] Misc cleanups and convert inner loop to asynch.
This is based on top of: https://github.com/nertpinx/v2v-conversion-host/commit/0bb2efdcacd975a2cae7380080991ac7fc238d2b The first 4 patches are fairly uncontroversial miscellaneous cleanups. Patch 5 is the interesting one. (Note it doesn't quite work yet, so it's for discussion only.) Patch 5 converts the inner loop to use asynchronous libnbd calls. performance improves quite a bit for
2018 Jun 21
0
[PATCH 2/2] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...eec7d3 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -19,11 +19,12 @@ import builtins import json import logging +import socket import ssl import sys import time -from http.client import HTTPSConnection +from http.client import HTTPSConnection, HTTPConnection from urllib.parse import urlparse import ovirtsdk4 as sdk @@ -117,6 +118,25 @@ def open(readonly): if time.time() > endt: raise RuntimeError("timed out waiting for disk to become unlocked") + # Get the current host. If it fails, don't worry. + host = None +...
2018 Jun 26
0
[PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...cc524c 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -19,11 +19,12 @@ import builtins import json import logging +import socket import ssl import sys import time -from http.client import HTTPSConnection +from http.client import HTTPSConnection, HTTPConnection from urllib.parse import urlparse import ovirtsdk4 as sdk @@ -56,6 +57,28 @@ def debug(s): print(s, file=sys.stderr) sys.stderr.flush() +def find_host(connection): + """Return the current host object or None.""" + try: + with builtin_open("...