Project

General

Profile

Actions

Bug #24779

closed

Python bindings use iteritems method which is not Python 3 compatible

Added by Nathan Cutler almost 6 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
mimic,luminous
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

In a number of places, the Ceph Python bindings use the iteritems method, which in Python 3 gives errors like:

g1:/var/log/ceph # ceph balancer status
Error EIO: Module 'balancer' has experienced an error and cannot handle commands: 'dict' object has no attribute 'iteritems' 

In order to make the code compatible with Python 3, these instances of iteritems need to be changed to items, subject to the caveat that, in Python 2, items does not produce an iterator. If the code demands an iterator, the iteritems function from six could be used since ceph-mgr already brings in six as a dependency (indirectly via bcrypt).

Backporting note: include https://github.com/ceph/ceph/commit/5f892430462 in the backport


Related issues 2 (0 open2 closed)

Copied to Ceph - Backport #24803: mimic: Python bindings use iteritems method which is not Python 3 compatibleResolvedNathan CutlerActions
Copied to Ceph - Backport #24804: luminous: Python bindings use iteritems method which is not Python 3 compatibleResolvedNathan CutlerActions
Actions #1

Updated by Nathan Cutler almost 6 years ago

  • Description updated (diff)
Actions #2

Updated by Nathan Cutler almost 6 years ago

  • Status changed from In Progress to Fix Under Review
Actions #3

Updated by Nathan Cutler almost 6 years ago

  • Description updated (diff)
Actions #4

Updated by Sage Weil almost 6 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #5

Updated by Nathan Cutler almost 6 years ago

  • Copied to Backport #24803: mimic: Python bindings use iteritems method which is not Python 3 compatible added
Actions #6

Updated by Nathan Cutler almost 6 years ago

  • Copied to Backport #24804: luminous: Python bindings use iteritems method which is not Python 3 compatible added
Actions #7

Updated by Nathan Cutler over 5 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF