Comment 2 for bug 1816468

Revision history for this message
Michal Arbet (michalarbet) wrote : Re: Acceleration cinder - glance with ceph not working

michalarbet@ut-9:~$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 'rbd://b%27868c2b5d-12f1-4f3f-aa2a-5701a3bb1041%27/images/eb816518-fac2-48f2-8197-ca7a83c89ada/snap'
>>> import urllib
>>> pieces = [urllib.parse.unquote(loc) for loc in a[len(prefix):].split('/')]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'prefix' is not defined
>>> prefix='rbd://'
>>> pieces = [urllib.parse.unquote(loc) for loc in a[len(prefix):].split('/')]
>>> print(pieces)
["b'868c2b5d-12f1-4f3f-aa2a-5701a3bb1041'", 'images', 'eb816518-fac2-48f2-8197-ca7a83c89ada', 'snap']