Bug 1041873

Summary: [RFE][keystone]: Update Driver base objects for Keystone pluggable systems to use ABCMeta metaclass
Product: Red Hat OpenStack Reporter: RHOS Integration <rhos-integ>
Component: openstack-keystoneAssignee: RHOS Maint <rhos-maint>
Status: CLOSED UPSTREAM QA Contact: Udi Kalifon <ukalifon>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: aberezin, ayoung, breeler, markmc, nkinder, yeylon
Target Milestone: Upstream M1Keywords: FutureFeature, Triaged
Target Release: 5.0 (RHEL 7)   
Hardware: Unspecified   
OS: Unspecified   
URL: https://blueprints.launchpad.net/keystone/+spec/abstract-base-class-drivers
Whiteboard: upstream_milestone_icehouse-1 upstream_status_implemented upstream_definition_new
Fixed In Version: openstack-keystone-2014.1-4.el7ost Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-22 11:48:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description RHOS Integration 2013-12-12 19:49:21 UTC
Cloned from launchpad blueprint https://blueprints.launchpad.net/keystone/+spec/abstract-base-class-drivers.

Description:

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)

Specification URL (additional information):

None

Comment 2 Stephen Gordon 2014-01-23 20:48:06 UTC
Moving to POST based on upstream status (Implemented).