"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/limit/models/base.py" between
keystone-16.0.1.tar.gz and keystone-17.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Ussuri" series (latest release).

base.py  (keystone-16.0.1):base.py  (keystone-17.0.0)
skipping to change at line 14 skipping to change at line 14
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import abc import abc
import six
import stevedore import stevedore
import keystone.conf import keystone.conf
from keystone.i18n import _ from keystone.i18n import _
CONF = keystone.conf.CONF CONF = keystone.conf.CONF
def load_driver(driver_name, *args): def load_driver(driver_name, *args):
namespace = 'keystone.unified_limit.model' namespace = 'keystone.unified_limit.model'
try: try:
driver_manager = stevedore.DriverManager(namespace, driver_manager = stevedore.DriverManager(namespace,
driver_name, driver_name,
invoke_on_load=True, invoke_on_load=True,
invoke_args=args) invoke_args=args)
return driver_manager.driver return driver_manager.driver
except stevedore.exception.NoMatches: except stevedore.exception.NoMatches:
msg = (_('Unable to find %(name)r driver in %(namespace)r.')) msg = (_('Unable to find %(name)r driver in %(namespace)r.'))
raise ImportError(msg % {'name': driver_name, 'namespace': namespace}) raise ImportError(msg % {'name': driver_name, 'namespace': namespace})
@six.add_metaclass(abc.ABCMeta) class ModelBase(object, metaclass=abc.ABCMeta):
class ModelBase(object):
"""Interface for a limit model driver.""" """Interface for a limit model driver."""
NAME = None NAME = None
DESCRIPTION = None DESCRIPTION = None
MAX_PROJECT_TREE_DEPTH = None MAX_PROJECT_TREE_DEPTH = None
def check_limit(self, limits): def check_limit(self, limits):
"""Check the new creating or updating limits if satisfy the model. """Check the new creating or updating limits if satisfy the model.
:param limits: A list of the limit references to be checked. :param limits: A list of the limit references to be checked.
 End of changes. 2 change blocks. 
3 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)