Project

General

Profile

Actions

Bug #5694

closed

test_cli uses python 2.7+ constructs

Added by Pauline Middelink almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
ceph-deploy
Target version:
-
% Done:

0%

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

Description

The earlier bugs on this subject, although marked Resolved, did not fix the issue. When I build an rpm under RHEL6/C6, I still get the dreaded ===
python setup.py bdist_rpm
[...]
byte-compiling /root/ceph-deploy/build/bdist.linux-x86_64/rpm/BUILDROOT/ceph-deploy-1.1-1.x86_64/usr/lib/python2.6/site-packages/ceph_deploy/forgetkeys.py to forgetkeys.pyc
writing byte-compilation script '/tmp/tmpFZJ9nq.py'
/usr/bin/python -O /tmp/tmpFZJ9nq.py
SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/ceph_deploy/tests/test_cli.py', 26, 26, ' assert {p.basename for p in tmpdir.listdir()} set()\n'))
=
A possible fix would be to replace the set comphrension with the list comphrension, as the result is just tested against the empty set/list. (C6 uses python 2.6.6, set comprehensions were introduced in python 2.7+)

Also mentioned in one of the earlier bugreports, the intend was to not distribute the tests at all. Attached is a diff which fixes both issues.


Files

t.diff (1.14 KB) t.diff Pauline Middelink, 07/20/2013 03:13 AM
Actions #1

Updated by Sage Weil almost 11 years ago

  • Assignee set to Alfredo Deza
  • Priority changed from Normal to Urgent
Actions #2

Updated by Alfredo Deza almost 11 years ago

  • Status changed from New to In Progress

I was not aware we were using Python 2.6

We will add that to our testing harness so we can run tests under 2.6 too and make sure they are passing before we attempt a release.

Leaving tests within a package is very useful though, so I am hesitant to remove tests from the actual package.

Actions #3

Updated by Alfredo Deza almost 11 years ago

  • Status changed from In Progress to 15
Actions #4

Updated by Alfredo Deza almost 11 years ago

  • Status changed from 15 to Closed
Actions

Also available in: Atom PDF