Displaying 14 results from an estimated 14 matches for "builtin_open".
Did you mean:
builtin_op_end
2018 Jun 27
1
Re: [PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
On Wed, Jun 27, 2018 at 12:37:20PM +0300, Nir Soffer wrote:
> I tested the patch yesterday, and unix socket did not work - silently.
>
> After changing the code to:
>
> try:
> with builtin_open("/etc/vdsm/vdsm.id") as f:
> vdsm_id = f.readline().strip()
> except Exception as e:
> debug("cannot read host hardware id: %s" % e)
> return None
>
> Then I got this message:
>
> cannot read host hardware id: name ...
2018 Jun 26
2
Re: [PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
....flush()
>
> +def find_host(connection):
> + """Return the current host object or None."""
>
I think we need a comment for this, something like:
# If we are running on a oVirt host, it must have a hardware id
# file.
> + try:
> + with builtin_open("/etc/vdsm/vdsm.id") as f:
> + vdsm_id = f.readline().strip()
> + except Exception as e:
> + return None
>
A debug message about no hardware id file would be nice to the person
looking at the logs later. Without this you will have to detect this case
by n...
2018 Jun 25
1
Re: [PATCH v2 2/2] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...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
> + try:
> + with builtin_open("/etc/vdsm/vdsm.id") as f:
>
Why use builtin_open() instead of open() or io.open()?
> + vdsm_id = f.readline().strip()
>
debug log with the host hardware id would be nice here.
> +
> + hosts_service = connection.system_service().hosts_service()
>...
2018 Jun 27
0
Re: [PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...>> + """Return the current host object or None."""
>>
>
> I think we need a comment for this, something like:
>
> # If we are running on a oVirt host, it must have a hardware id
> # file.
>
>
>> + try:
>> + with builtin_open("/etc/vdsm/vdsm.id") as f:
>> + vdsm_id = f.readline().strip()
>> + except Exception as e:
>> + return None
>
>
>
>
> A debug message about no hardware id file would be nice to the person
> looking at the logs later. Without this yo...
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
2019 Sep 09
1
Re: [PATCH] v2v: rhv-upload-plugin - improve wait logic after finalize (RHBZ#1680361)
...> + break
> except sdk.NotFoundError:
> - pass
> + raise RuntimeError("transfer failed: disk %s not found" %
> disk_id)
>
> # Write the disk ID file. Only do this on successful completion.
> with builtin_open(params['diskid_file'], 'w') as fp:
> --
> 1.8.3.1
>
Looks good.
Nir
2019 Sep 09
3
[PATCH] v2v: rhv-upload-plugin - improve wait logic after finalize
This is a patch which Daniel Erez wrote originally. I have modified
it only to fix a small bug in the debug() statement, and Ilanit kindly
tested it here:
https://bugzilla.redhat.com/show_bug.cgi?id=1680361#c38
Rich.
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 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
2019 Sep 09
0
[PATCH] v2v: rhv-upload-plugin - improve wait logic after finalize (RHBZ#1680361)
...seconds" % (time.time() - start))
+ break
except sdk.NotFoundError:
- pass
+ raise RuntimeError("transfer failed: disk %s not found" % disk_id)
# Write the disk ID file. Only do this on successful completion.
with builtin_open(params['diskid_file'], 'w') as fp:
--
1.8.3.1
2018 Jun 21
0
[PATCH 2/2] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...se
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
+ try:
+ with builtin_open("/etc/vdsm/vdsm.id") as f:
+ vdsm_id = f.readline().strip()
+
+ hosts_service = connection.system_service().hosts_service()
+ hosts = hosts_service.list(
+ search="hw_id=%s" % vdsm_id,
+ case_sensitive=False,
+ )
+ if...
2018 Jun 26
0
[PATCH v3] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...ection
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("/etc/vdsm/vdsm.id") as f:
+ vdsm_id = f.readline().strip()
+ except Exception as e:
+ return None
+ debug("hw_id = %r" % vdsm_id)
+
+ hosts_service = connection.system_service().hosts_service()
+ hosts = hosts_service.list(
+ search="hw...
2018 Jun 22
0
[PATCH v2 2/2] v2v: -o rhv-upload: Use Unix domain socket to access imageio (RHBZ#1588088).
...se
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
+ try:
+ with builtin_open("/etc/vdsm/vdsm.id") as f:
+ vdsm_id = f.readline().strip()
+
+ hosts_service = connection.system_service().hosts_service()
+ hosts = hosts_service.list(
+ search="hw_id=%s" % vdsm_id,
+ case_sensitive=False,
+ )
+ if...
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