From 8b7fe7139dc47a421dd34376374a0ed06dc73f39 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Tue, 2 Sep 2008 17:29:01 +0000 Subject: 228: plugable.check_name() now uses errors.check_type() --- ipalib/plugable.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ipalib/plugable.py') diff --git a/ipalib/plugable.py b/ipalib/plugable.py index 811a5527..9880b0a0 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -28,6 +28,7 @@ http://docs.python.org/ref/sequence-types.html import re import inspect import errors +from errors import check_type, check_isinstance class ReadOnly(object): @@ -466,7 +467,7 @@ def check_name(name): :param name: Identifier to test. """ - assert type(name) is str, 'must be %r' % str + check_type(name, str, 'name') regex = r'^[a-z][_a-z0-9]*[a-z0-9]$' if re.match(regex, name) is None: raise errors.NameSpaceError(name, regex) -- cgit