Python RBD metadata_get does not work.
Here is the part of traceback:
metaval = rbd_image.metadata_get('backup-skip') File "rbd.pyx", line 2687, in rbd.Image.metadata_get (/build/ceph-12.2.1/obj-x86_64-linux-gnu/src/pybind/rbd3/pyrex/rbd.c:30949) AttributeError: 'rbd.Image' object has no attribute 'key'
#5 Updated by Mykola Golub almost 2 years ago
Mark, I assume 'backup-skip' metadata key did not exist before metadata_get call? Otherwise I would not expect the error.
Anyway, there is a bug in the metadata function error handling I fix in this PR: https://github.com/ceph/ceph/pull/19337
Note, with the fix it will still throw the exception in the case like yours, though the error will be different:
"ImageNotFound: [errno 2] error getting metadata backup-skip for image ...". You will need to catch the exception if you want to tolerate non-existent keys.