versionutils.deprecated fails for classes (intended only for functions)

Bug #1337889 reported by Timur Sufiev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo-incubator
Fix Released
Low
Timur Sufiev

Bug Description

Class objects wrapped with that decorator are no longer classes, but functions (which breaks their functionality). So versionutils.deprecated can only be used to decorate functions. The idea is to tweak it a little bit, so it will be able to decorate also the classes. Deprecation message will be produced each time the decorated class is instantiated.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/104916

Changed in oslo:
assignee: nobody → Timur Sufiev (tsufiev-x)
status: New → In Progress
Changed in oslo:
importance: Undecided → Low
status: In Progress → Triaged
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/104916
Committed: https://git.openstack.org/cgit/openstack/oslo-incubator/commit/?id=1c3ecfcd4d11f02efec411ccb15318c883b82101
Submitter: Jenkins
Branch: master

commit 1c3ecfcd4d11f02efec411ccb15318c883b82101
Author: Timur Sufiev <email address hidden>
Date: Fri Jul 4 18:58:47 2014 +0400

    Enhance versionutils.deprecated to work with classes

    If object being decorated is a function, it is processed as before,
    otherwise a new class is created which logs deprecated message when
    class is instantiated. This change comes with 2 unit tests.

    Closes-Bug: #1337889
    Change-Id: Ib5cc04bea0ff2ea588618599f4e42df16cb85a0d

Changed in oslo:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in oslo-incubator:
milestone: none → juno-3
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.