Project

General

Profile

Bug #22306

Python RBD metadata_get does not work.

Added by Марк Коренберг over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
Start date:
12/03/2017
Due date:
% Done:

0%

Source:
Tags:
rbd python metadata image-meta
Backport:
luminous
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
rbd
Pull request ID:

Description

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'


Related issues

Copied to rbd - Backport #22376: luminous: Python RBD metadata_get does not work. Resolved

History

#1 Updated by Patrick Donnelly over 1 year ago

  • Project changed from Ceph to rbd

#2 Updated by Mykola Golub over 1 year ago

  • Status changed from New to In Progress
  • Assignee set to Mykola Golub

#3 Updated by Mykola Golub over 1 year ago

  • Subject changed from Python RBD metadata_get dows not work. to Python RBD metadata_get does not work.

#4 Updated by Mykola Golub over 1 year ago

  • Backport set to luminous

#5 Updated by Mykola Golub over 1 year 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.

#6 Updated by Jason Dillaman over 1 year ago

  • Status changed from In Progress to Pending Backport

#7 Updated by Nathan Cutler over 1 year ago

  • Copied to Backport #22376: luminous: Python RBD metadata_get does not work. added

#8 Updated by Nathan Cutler over 1 year ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF