cinderlib/playbooks
Gorka Eguileor 543fe8a7d2 Fix rbd attach on python3
Attaching an RBD volume fails when we run the code as root if we are
using Python 3.

We see a DeviceUnavailable exception:

    conn.attach()
  File "/usr/lib/python3.6/site-packages/cinderlib/objects.py", line
    842, in attach reason=error_msg)
cinder.exception.DeviceUnavailable: The device in the path None is
unavailable: Unable to access the backend storage via path /dev/rbd0.

The exception message also shows None as the path, even though the
description of the exception shows it correctly.

The underlying error is a UnicodeDecodeError that happens because when
we run as root we open the RBD device directly in Python to check if it
is available, but we do it as text, not as binary.

This patch changes how we open the file, doing it as binary, and reports
the right path on the exception.

Closes-Bug: #1873312
Change-Id: I967caa2df84d870c1be4d69f32481fc75c3be010
2020-04-22 13:39:40 +02:00
..
cinder-gate-run.yaml zuul: change the cinderlib test runner into a role 2019-07-31 16:51:37 +02:00
setup-ceph.yaml Fix rbd attach on python3 2020-04-22 13:39:40 +02:00
setup-lvm.yaml Use Python 3 by default and drop Python 2 2020-01-10 15:03:23 +01:00