Update Driver base objects for Keystone pluggable systems to use ABCMeta metaclass

Registered by Morgan Fainberg on 2013-08-25

The keystone driver classes (e.g. token, provider, assignment, identity, etc) should be updated to utilize the ABCMeta (abc module) metaclass.

The drivers should be actual abstract classes, since that is what they effectively are. This functionality is used in Neutron, Ironic, and Ceilometer. This will also help to push error discovery at class instantiation time instead of during a method call at some indeterminate time in the future. This also will allow base functionality to be implemented in the driver methods that can be called via super() but not break the method overriding requirement in subclasses.

PEP describing the use of ABCs
http://www.python.org/dev/peps/pep-3119/

This implementation should utilize six to be py3k compatible.

Example:

class AbstractBaseClassTest(six.with_metaclass(abc.ABCMeta)):
    @abc.abstractmethod
    def abstract_method1(int_arg):
        # we can do something here instead of raising
        # NotImplemented()
        return (int_arg + 1)

Blueprint information

Status:
Complete
Approver:
None
Priority:
Medium
Drafter:
None
Direction:
Needs approval
Assignee:
Doug Hellmann
Definition:
New
Series goal:
Accepted for icehouse
Implementation:
Implemented
Milestone target:
milestone icon 2014.1
Started by
Dolph Mathews on 2013-10-07
Completed by
Dolph Mathews on 2013-11-25

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/abstract-base-class-drivers,n,z

Addressed by: https://review.openstack.org/49789 (merged)
    Use abstract base class for identity driver

Gerrit topic: https://review.openstack.org/#q,topic:use-abc-for-plugins,n,z

Addressed by: https://review.openstack.org/50073 (merged)
    Use abstract base class for trust driver

Addressed by: https://review.openstack.org/50074 (merged)
    Use abstract base class for assignment driver

Addressed by: https://review.openstack.org/50075 (merged)
    Use abstract base class for credential driver

Addressed by: https://review.openstack.org/50076 (merged)
    Use abstract base class for catalog driver

Addressed by: https://review.openstack.org/50077 (merged)
    Use abstract base class for auth handler

Addressed by: https://review.openstack.org/50078 (merged)
    Use abstract base class for token driver

Addressed by: https://review.openstack.org/50079 (merged)
    Use abstract base class for policy driver

Addressed by: https://review.openstack.org/50080 (merged)
    Use abstract base class for oauth driver

Addressed by: https://review.openstack.org/50081 (merged)
    Use abstract base class for endpoint_filter driver

Addressed by: https://review.openstack.org/50082 (merged)
    Remove obsolete driver test module

Addressed by: https://review.openstack.org/57048 (merged)
    Allow use of rules Policy driver

Addressed by: https://review.openstack.org/61034
    Add ABCMeta metaclass to token provider

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.